Review Request: load and save draw:id and text:id also as xml:id

Thorsten Zachmann t.zachmann at zagge.de
Sun Feb 26 04:16:15 GMT 2012


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


Nice work. There are some comments. I will do a test run (odf roundtrip testing) once all noticed stuff has been fixed. Would it be possible to not merge the branch but apply a diff to master so it goes in as one commit. I think that will make sure it is easier to understand.


filters/stage/pptx/PptxXmlSlideReader.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8845>

    It seems your patch creation is not against the latest master.



libs/flake/KoShape.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8846>

    Including it once is enough.



libs/flake/KoShape.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8847>

    According to ODF 19.187.2 <draw:glue-point> does not support xml:id. Please revert this change. It does not reference a different object but is a number and therefore it is only draw:id.
    
    I just see that it also wrongly writes out an xml:id. Maybe when you are on it can you please remove this.
    



libs/flake/KoShapeSavingContext.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8848>

    I think this should be changed to 
    
    Q_ASSERT(!counter || counter && !prefix.empty()); 
    which can be shorten to 
    Q_ASSERT(!counter || !prefix.empty());
    
    As then there is no useless if in release mode.



libs/flake/KoShapeSavingContext.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8849>

    It is not needed to check that the referent is not in yet as it is already checked some lines above.



libs/flake/KoShapeSavingContext.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8850>

    The if can be removed if you use d->prefixedReferenced.value(prefix) in the next line.



libs/flake/KoShapeSavingContext.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8851>

    If you use iterators one lookup into the map can be avoided. 



libs/kopageapp/KoPAMasterPage.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8852>

    No need to add this line.



libs/kopageapp/KoPAMasterPage.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8853>

    No need to add this line.



libs/kopageapp/KoPAPage.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8854>

    No need to add this line.



libs/kopageapp/KoPAPastePage.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8855>

    Please keep this comment.



libs/kopageapp/tests/TestPACopyPastePage.h
<http://git.reviewboard.kde.org/r/104074/#comment8856>

    This change seems wrong to me. Please revert.



libs/kotext/KoTextDrag.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8857>

    Please remove this line.



libs/kotext/opendocument/KoTextWriter_p.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8858>

    This looks somewhat suspicious. I don't know the RDF stuff well enough to be sure but should it not check if there is a inlineRdf and add a xmlid in that case or is that done in this code



stage/part/animations/KPrAnimationBase.cpp
<http://git.reviewboard.kde.org/r/104074/#comment8859>

    Setting the parameter shape is a bit misleading her as it does not read anything that is a shape here.


- Thorsten Zachmann


On Feb. 25, 2012, 3:12 p.m., Boudewijn Rempt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104074/
> -----------------------------------------------------------
> 
> (Updated Feb. 25, 2012, 3:12 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> draw:id and text:id are deprecated and to be replaced by xml:id. This patch creates a new class KoElementReference that encapsulates loading and saving all three tags, as well as automatically generating a unique id. This is used to make sure that if two items want to save an xml:id on the same element, we only have one, unique tag saved.
> 
> I'm not completely happy yet, since parts of KoShapeSavingContext still create numbered, prefixed id's with hidden meanings that are not clearly connect to what the idref actually links to for the master pages. Imo, xml:id should always be guaranteed unique and there should be a clear code-path between the entity that is linked to from an element and the element itself.
> 
> 
> This addresses bug 288644.
>     http://bugs.kde.org/show_bug.cgi?id=288644
> 
> 
> Diffs
> -----
> 
>   filters/stage/kpr2odf/Filterkpr2odf.cpp df7079b 
>   filters/stage/pptx/PptxXmlSlideReader.cpp eaee384 
>   filters/words/docx/DocxXmlDocumentReader.cpp 6aa31f5 
>   filters/words/oowriter/ExportFilter.h dea56bd 
>   filters/words/oowriter/ExportFilter.cc ff44e0c 
>   karbon/common/KarbonDocument.cpp 6057a18 
>   krita/ui/flake/kis_shape_layer.cc 8aaca9d 
>   krita/ui/flake/kis_shape_selection.cpp 95ebeb6 
>   libs/flake/KoConnectionShape.cpp fda3463 
>   libs/flake/KoImageCollection.cpp 27b8260 
>   libs/flake/KoShape.cpp be34b8a 
>   libs/flake/KoShapeLoadingContext.h 87b0830 
>   libs/flake/KoShapeLoadingContext.cpp 0573ddf 
>   libs/flake/KoShapeSavingContext.h c73a680 
>   libs/flake/KoShapeSavingContext.cpp 46cb477 
>   libs/kopageapp/KoPADocument.cpp 49ac34a 
>   libs/kopageapp/KoPAMasterPage.cpp 42e9065 
>   libs/kopageapp/KoPAPage.cpp fbcf49d 
>   libs/kopageapp/KoPAPastePage.cpp 9fd795e 
>   libs/kopageapp/tests/TestPACopyPastePage.h 363f803 
>   libs/kopageapp/tests/TestPACopyPastePage.cpp 3b023b8 
>   libs/kotext/KoDocumentRdfBase.h d6f467a 
>   libs/kotext/KoDocumentRdfBase.cpp 7b6b38c 
>   libs/kotext/KoInlineNote.h 91823e9 
>   libs/kotext/KoInlineNote.cpp 897214c 
>   libs/kotext/KoInlineObject.h 8a1d627 
>   libs/kotext/KoTextAnchor.cpp 414b347 
>   libs/kotext/KoTextBlockData.h cc1528b 
>   libs/kotext/KoTextBlockData.cpp 116b432 
>   libs/kotext/KoTextDrag.cpp 381f4de 
>   libs/kotext/KoTextInlineRdf.h fd7bb5e 
>   libs/kotext/KoTextInlineRdf.cpp f449426 
>   libs/kotext/changetracker/KoChangeTracker.h 33c2696 
>   libs/kotext/changetracker/KoChangeTracker.cpp 51b9c5e 
>   libs/kotext/opendocument/KoTextLoader.cpp 3ea7109 
>   libs/kotext/opendocument/KoTextWriter.h fd0689c 
>   libs/kotext/opendocument/KoTextWriter.cpp 56125d3 
>   libs/kotext/opendocument/KoTextWriter_p.h c89e895 
>   libs/kotext/opendocument/KoTextWriter_p.cpp 1dbc8bb 
>   libs/kotext/opendocument/tests/CMakeLists.txt c386cfb 
>   libs/kotext/opendocument/tests/TestChangeTracking.cpp 665636b 
>   libs/main/rdf/KoDocumentRdf.h fabc628 
>   libs/main/rdf/KoDocumentRdf.cpp bfaa9ec 
>   libs/odf/CMakeLists.txt 838d4f6 
>   libs/odf/KoElementReference.h PRE-CREATION 
>   libs/odf/KoElementReference.cpp PRE-CREATION 
>   libs/odf/KoEmbeddedDocumentSaver.cpp 36506ca 
>   libs/odf/KoGenChange.cpp 2cd2d97 
>   libs/odf/KoGenChanges.h d7b51ee 
>   libs/odf/KoGenChanges.cpp b64d32d 
>   libs/odf/tests/CMakeLists.txt ee86038 
>   libs/odf/tests/TestKoElementReference.h PRE-CREATION 
>   libs/odf/tests/TestKoElementReference.cpp PRE-CREATION 
>   plan/libs/ui/reports/odt/KoSimpleOdtCheckBox.cpp 79ac92c 
>   plan/libs/ui/reports/odt/KoSimpleOdtLine.cpp 6cddad2 
>   plan/libs/ui/reports/odt/KoSimpleOdtPicture.cpp 20aee62 
>   plan/libs/ui/reports/odt/KoSimpleOdtTextBox.cpp 717b867 
>   stage/part/animations/KPrAnimationBase.cpp b544485 
>   tables/part/Doc.cpp 25e3fd3 
>   words/part/KWOdfLoader.cpp af269ab 
>   words/part/KWOdfWriter.cpp b998485 
> 
> Diff: http://git.reviewboard.kde.org/r/104074/diff/
> 
> 
> Testing
> -------
> 
> Manual testing and unittests; on Tuesday I will do a practical test at SKF.
> 
> 
> Thanks,
> 
> Boudewijn Rempt
> 
>

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


More information about the calligra-devel mailing list