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

Miklos Vajna vmiklos at collabora.co.uk
Wed Nov 19 08:43:35 PST 2014


 sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                |    7 +++++++
 writerfilter/source/dmapper/NumberingManager.cxx        |    3 ++-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx          |   14 +++++++-------
 4 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 122d97673d762cc5fc043bdadfdf4cb80ac871cf
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 19 17:34:45 2014 +0100

    writerfilter: indentation fixes
    
    Change-Id: Ib9bee587931cd020848b033ce4429f36d04e61b1

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1234e37..5481466 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5865,7 +5865,7 @@ int RTFDocumentImpl::popState()
             RTFValue::Pointer_t pValue(new RTFValue(aState.aDestinationText.makeStringAndClear(), true));
             m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelSuffix_val, pValue);
         }
-    break;
+        break;
     case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
         if (!m_aStates.empty())
         {
@@ -5873,7 +5873,7 @@ int RTFDocumentImpl::popState()
             RTFValue::Pointer_t pValue(new RTFValue(aState.aDestinationText.makeStringAndClear(), true));
             m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelText_val, pValue);
         }
-    break;
+        break;
     case DESTINATION_LISTNAME:
         break;
     case DESTINATION_LISTLEVEL:
@@ -5888,7 +5888,7 @@ int RTFDocumentImpl::popState()
             else
                 m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_NumLvl_lvl, pValue);
         }
-    break;
+        break;
     case DESTINATION_LFOLEVEL:
         if (!m_aStates.empty())
         {
@@ -5898,7 +5898,7 @@ int RTFDocumentImpl::popState()
             RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, aState.aTableSprms));
             m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, pValue);
         }
-    break;
+        break;
     // list override table
     case DESTINATION_LISTOVERRIDEENTRY:
         if (!m_aStates.empty())
@@ -5916,14 +5916,14 @@ int RTFDocumentImpl::popState()
                 m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_num, pValue, OVERWRITE_NO_APPEND);
             }
         }
-    break;
+        break;
     case DESTINATION_LEVELTEXT:
         if (!m_aStates.empty())
         {
             RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes));
             m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_lvlText, pValue);
         }
-    break;
+        break;
     case DESTINATION_LEVELNUMBERS:
         if (!m_aStates.empty())
             m_aStates.top().aTableSprms = aState.aTableSprms;
@@ -5947,7 +5947,7 @@ int RTFDocumentImpl::popState()
             // both \sp and \sv are destinations, copy the text up-ward for later
             m_aStates.top().aDestinationText = aState.aDestinationText;
         }
-    break;
+        break;
     case DESTINATION_FALT:
         if (!m_aStates.empty())
             m_aStates.top().aTableSprms = aState.aTableSprms;
commit d9f0c19edde7cb28086860ea6b3519be0d49a3e0
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 19 17:25:04 2014 +0100

    DOCX import: handle <w:lvlOverride> without <w:lvlText>
    
    Change-Id: I0b941bd7a733408655db192b8608ed3987b9c1fc

diff --git a/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx b/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx
new file mode 100644
index 0000000..5ee3602
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/num-override-lvltext.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 964ec96..8c78d45 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -591,6 +591,13 @@ DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
     CPPUNIT_ASSERT(getProperty<OUString>(getParagraph(4), "NumberingStyleName").startsWith("WWNum"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
+{
+    uno::Reference<container::XIndexAccess> xRules = getProperty< uno::Reference<container::XIndexAccess> >(getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules");
+    // This was 1, i.e. the numbering on the second level was "1", not "1.1".
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(2), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["ParentNumbering"].get<sal_Int16>());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 2d5618d..af2c2e3 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -614,7 +614,8 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
                 // Get the prefix / suffix / Parent numbering
                 // and add them to the level properties
                 OUString sText = pAbsLevel->GetBulletChar( );
-                if ( pLevel.get( ) )
+                // Inherit <w:lvlText> from the abstract level in case the override would be empty.
+                if (pLevel.get() && !pLevel->GetBulletChar().isEmpty())
                     sText = pLevel->GetBulletChar( );
 
                 OUString sPrefix;


More information about the Libreoffice-commits mailing list