Review Request: User defined variables (2)

Sebastian Sauer mail at dipe.org
Mon Dec 5 09:50:47 GMT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103276/
-----------------------------------------------------------

(Updated Dec. 5, 2011, 9:50 a.m.)


Review request for Calligra and Thorsten Zachmann.


Changes
-------

updated diff with current changes


Description
-------

Following patch implements user defined variables. This solves bug https://bugs.kde.org/show_bug.cgi?id=282972

What I did;
* extended the KoVariableManager to handle now also such user defined variables.
* the KoVariableManager now has loadOdf and saveOdf methods to load and save user defined variables declarations.
* the user defined variables are implemented using the new plugins/variables/User* classes.
* KoVariable::manager() can now be used even on KoVariable::createOptionsWidget
* replaced the previous unused KoInlineObject::User with KoInlineObject::UserGet and KoInlineObject::UserInput and make use of them
* extended KoTextLoader.cpp to proper load user defined variables into the KoVariableManager. Instances are created using the new UserVariable plugin.
* extended KoOdfNumberStyles with the formatFraction method. Ideally I would also move the other format (e.g. formatDate, formatTime, etc.) methods from the plugin to the KoOdfNumberStyles class to have it reusable (we at least need formatDate and KoOdfNumberStyles also in the DateVariable later).
* added the KoOdfNumberStyles::saveOdfBooleanStyle to also save boolean formattings proper back.
* introduced the KoOdfNumberStyles::saveOdfNumberStyle method to handle choosing the proper KoOdfNumberStyles::saveOdf*Style methods.
* extended KWOdfWriter.cpp to proper save the user defined variable declarations back to the ODT.

Remaining problems;
* there is no way to add/edit/remove/display such user defined variables in Calligra Tables. Seems oocalc has the same problem.
* the UI still misses a way to set/modify custom formatings.
* support for formulas... but this is another beast and partly already covered at bug 283816. I do not plan to work on this anytime soon.

Update to the first review-request at https://git.reviewboard.kde.org/r/102890/ ;
* loading of the variables happens now not any longer in the KoTextLoader but in the applications themself right after loading the body-element what is inline with how saving is done.
* the same logic is applied to Calligra Words, Stage and Tables what means all 3 of them support now loading and saving of user defined variables. Editing can be done direct in the Insert=>Variable=>Custom (should we better rename it to "User defined" rather then "Custom"?) dialog what is inline with how it can be done in OO.org/LO.


Diffs (updated)
-----

  libs/kopageapp/KoPADocument.cpp 43e002a 
  libs/kotext/InsertVariableAction.cpp de68bbf 
  libs/kotext/KoInlineObject.h 205053d 
  libs/kotext/KoVariableManager.h 680a29b 
  libs/kotext/KoVariableManager.cpp a915b77 
  libs/kotext/tests/TestKoInlineTextObjectManager.cpp b584a3d 
  libs/odf/KoOdfNumberStyles.h 536408d 
  libs/odf/KoOdfNumberStyles.cpp 5611465 
  libs/odf/KoXmlReader.h 3e26853 
  libs/odf/KoXmlReader.cpp a7f5ce4 
  libs/odf/tests/CMakeLists.txt a1c71dc 
  libs/odf/tests/TestNumberStyle.h PRE-CREATION 
  libs/odf/tests/TestNumberStyle.cpp PRE-CREATION 
  plugins/variables/CMakeLists.txt cca8198 
  plugins/variables/UserVariable.h PRE-CREATION 
  plugins/variables/UserVariable.cpp PRE-CREATION 
  plugins/variables/UserVariableFactory.h PRE-CREATION 
  plugins/variables/UserVariableFactory.cpp PRE-CREATION 
  plugins/variables/UserVariableOptionsWidget.h PRE-CREATION 
  plugins/variables/UserVariableOptionsWidget.cpp PRE-CREATION 
  plugins/variables/VariablesPlugin.cpp 913aebc 
  stage/part/KPrDocument.cpp 841e86a 
  words/part/KWAboutData.h 68e9a6f 
  words/part/KWOdfLoader.cpp 837280a 
  words/part/KWOdfWriter.cpp ebfdad9 

Diff: http://git.reviewboard.kde.org/r/103276/diff/diff


Testing
-------

see the documents attached to bug 282972


Thanks,

Sebastian Sauer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20111205/fede483d/attachment.htm>


More information about the calligra-devel mailing list