[Libreoffice-commits] core.git: 3 commits - solenv/bin sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jul 21 00:09:21 PDT 2015


 solenv/bin/create-tags                            |    5 +++--
 sw/qa/extras/ooxmlimport/data/tdf89702.docx       |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx          |   14 ++++++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx      |    7 +------
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   16 ++++++++++------
 5 files changed, 28 insertions(+), 14 deletions(-)

New commits:
commit f46bbb9f60a487e62f1fb028570329c0f2dff959
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 21 09:07:45 2015 +0200

    Use comphelper::containerToSequence()
    
    Change-Id: Ia7cc48f6f1bc041b95164d551e2cbc9ea2dbf2e8

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 8a875ae..6a4a85a 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3462,15 +3462,10 @@ beans::PropertyValue DomainMapper::getInteropGrabBag()
 {
     beans::PropertyValue aRet;
     aRet.Name = m_pImpl->m_aInteropGrabBagName;
-
-    uno::Sequence<beans::PropertyValue> aSeq(m_pImpl->m_aInteropGrabBag.size());
-    beans::PropertyValue* pSeq = aSeq.getArray();
-    for (std::vector<beans::PropertyValue>::iterator i = m_pImpl->m_aInteropGrabBag.begin(); i != m_pImpl->m_aInteropGrabBag.end(); ++i)
-        *pSeq++ = *i;
+    aRet.Value = uno::makeAny(comphelper::containerToSequence(m_pImpl->m_aInteropGrabBag));
 
     m_pImpl->m_aInteropGrabBag.clear();
     m_pImpl->m_aInteropGrabBagName.clear();
-    aRet.Value = uno::makeAny(aSeq);
     return aRet;
 }
 
commit a5da2a353f21debba7ef6262c01957c43b4f1c6e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 21 09:06:22 2015 +0200

    create-tags: recognize C++11 features hidden behind SAL macros
    
    With this, not only the definition, but also the declaration of e.g.
    'SwTextFrm::Format' (or any other member function that is overriding a
    virtual function from a base class) can be found again, just like before
    SAL_OVERRIDE and the similar macros were introduced.
    
    Change-Id: Ic9e429ad7cbb0a1212744115d1567bb79b7c6aa0

diff --git a/solenv/bin/create-tags b/solenv/bin/create-tags
index 7334936..639111c 100755
--- a/solenv/bin/create-tags
+++ b/solenv/bin/create-tags
@@ -12,9 +12,10 @@ if test "$1" = "-e"; then
     ctags=etags
 fi
 
+saloptions="-ISAL_DELETED_FUNCTION -ISAL_OVERRIDE -ISAL_FINAL -ISAL_CONSTEXPR"
 omnicppoptions="--c++-kinds=+p --fields=+iaS --extra=+q"
 
-$ctags -h "+.hdl.hrc" --langmap=c:+.hrc.src,c++:+.hdl $omnicppoptions \
+$ctags -h "+.hdl.hrc" --langmap=c:+.hrc.src,c++:+.hdl $saloptions $omnicppoptions \
       --languages=-HTML,Java,JavaScript \
       -R --exclude=instdir --exclude=instdir_for_build --exclude=workdir --exclude=workdir_for_build \
       --exclude=clone --exclude=external --totals=yes ${SRCDIR:-*}
@@ -25,7 +26,7 @@ else
     w=workdir
 fi
 
-$ctags -h "+.hdl.hrc" --langmap=c:+.hrc.src,c++:+.hdl $omnicppoptions \
+$ctags -h "+.hdl.hrc" --langmap=c:+.hrc.src,c++:+.hdl $saloptions $omnicppoptions \
       --languages=-HTML,Java,JavaScript \
       -R --append=yes --totals=yes \
       $w/UnoApiHeadersTarget/udkapi/normal \
commit fc7c1a07d0d5e21a4e1533a0e5b0ac256763f973
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 21 09:04:44 2015 +0200

    tdf#89702 DOCX import: fix too large bullet character
    
    Commit c1f8437dbed0e8b989e41a345ef7e658a6e8a4cd (fdo#83465 RTF import:
    handle font of numbering, 2014-09-25), changed the "get the me character
    style of the current numbering's current level" member function to be
    successfull even in case we're inside a DOCX run, not when we're inside
    a DOCX paragraph, but outside runs.
    
    While this is necessary for RTF, the side effect of this was that
    unwanted run properties started to affect the above mentioned character
    style in case of DOCX.
    
    Fix the problem by enabling the "in paragraph and run" looking for RTF
    only.
    
    Change-Id: I610bfce6cec15b918fe547402360f5a894401f7e

diff --git a/sw/qa/extras/ooxmlimport/data/tdf89702.docx b/sw/qa/extras/ooxmlimport/data/tdf89702.docx
new file mode 100644
index 0000000..5542d1c
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf89702.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index afc1f02..6ae2e0b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2734,6 +2734,20 @@ DECLARE_OOXMLIMPORT_TEST(testTdf90611, "tdf90611.docx")
     CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getParagraphOfText(1, xFootnoteText), "CharHeight"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf89702, "tdf89702.docx")
+{
+    // Get the first paragraph's numbering style's 2nd level's character style name.
+    uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
+    auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules");
+    uno::Sequence<beans::PropertyValue> aLevel;
+    xLevels->getByIndex(1) >>= aLevel; // 2nd level
+    OUString aCharStyleName = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "CharStyleName"; })->Value.get<OUString>();
+
+    // Make sure that the font name is Arial, this was Verdana.
+    uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName(aCharStyleName), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xStyle, "CharFontName"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index cfa1b83..473e47d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5014,12 +5014,16 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::GetCurrentNumberingCharSt
         uno::Reference<container::XIndexAccess> xLevels = GetCurrentNumberingRules(&nListLevel);
         if (!xLevels.is())
         {
-            // Looking up the paragraph context explicitly (and not just taking
-            // the top context) is necessary for RTF, where formatting of a run
-            // and of the paragraph mark is not separated.
-            PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_PARAGRAPH);
-            if (!pContext)
-                return xRet;
+            PropertyMapPtr pContext = m_pTopContext;
+            if (IsRTFImport())
+            {
+                // Looking up the paragraph context explicitly (and not just taking
+                // the top context) is necessary for RTF, where formatting of a run
+                // and of the paragraph mark is not separated.
+                pContext = GetTopContextOfType(CONTEXT_PARAGRAPH);
+                if (!pContext)
+                    return xRet;
+            }
 
             // In case numbering rules is not found via a style, try the direct formatting instead.
             boost::optional<PropertyMap::Property> oProp = pContext->getProperty(PROP_NUMBERING_RULES);


More information about the Libreoffice-commits mailing list