[Libreoffice-commits] core.git: 2 commits - sw/qa writerfilter/source

Luboš Luňák l.lunak at suse.cz
Fri Apr 26 09:43:19 PDT 2013


 sw/qa/extras/ooxmlimport/ooxmlimport.cxx           |    2 +-
 writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx |   16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 391c45ce86ad8de44089ecde6800301a854136df
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri Apr 26 18:30:14 2013 +0200

    Revert "temporarily disable conditionalstyles-tbllook.docx test"
    
    Already worked around.
    This reverts commit f853a20839ab08244dc1b3b1c881822bd593bc04.

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 27387ed..25e4495 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -182,7 +182,7 @@ void Test::run()
         {"fdo60922.docx", &Test::testFdo60922},
         {"fdo59273.docx", &Test::testFdo59273},
         {"table_width.docx", &Test::testTableWidth},
-//        {"conditionalstyles-tbllook.docx", &Test::testConditionalstylesTbllook},
+        {"conditionalstyles-tbllook.docx", &Test::testConditionalstylesTbllook},
         {"fdo63685.docx", &Test::testFdo63685},
     };
     header();
commit 76336334e669519cfa42413b851584fa321c004d
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Fri Apr 26 18:29:17 2013 +0200

    ugly hack for NS_ooxml::LN_CT_Style_type being the first attribute processed
    
    Change-Id: I32e91c1a42619676467ac121865673733e8053f2

diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
index a97759e..b8f5aa3 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/drawing/XShape.hpp>
 #include <ooxml/OOXMLFastTokens.hxx>
 #include "ooxmlLoggers.hxx"
+#include <ooxml/resourceids.hxx>
 
 namespace writerfilter {
 namespace ooxml
@@ -467,7 +468,20 @@ void OOXMLPropertySetImpl::add(OOXMLProperty::Pointer_t pProperty)
 
     if (pProperty.get() != NULL && pProperty->getId() != 0x0)
     {
-        mProperties.push_back(pProperty);
+        /*
+         HACK: Ugly hack. This retarded overdesigned writerfilter thing
+         processes attributes in random order (as given by boost::unordered_map
+         when iterating it), but StyleSheetTable::lcl_attribute() needs
+         to know whether NS_ooxml::LN_CT_Style_type is STYLE_TYPE_TABLE first.
+         And all this overdesigned machinery doesn't even give a reasonable
+         way to find out if an attribute is there before encountering it
+         in random order in lcl_attribute(), so just make sure here that
+         the attribute comes first.
+        */
+        if( pProperty->getId() == NS_ooxml::LN_CT_Style_type )
+            mProperties.insert( mProperties.begin(), pProperty );
+        else
+            mProperties.push_back(pProperty);
     }
 #ifdef DEBUG_PROPERTY_SET
     else


More information about the Libreoffice-commits mailing list