[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.4' - 3 commits - sc/inc sc/source sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Oct 6 23:31:22 PDT 2015


 sc/inc/autoform.hxx                          |    6 +++++-
 sc/source/core/data/formulacell.cxx          |    6 +++---
 sc/source/core/tool/autoform.cxx             |   10 ++++++++++
 sw/qa/extras/ooxmlimport/data/tdf92454.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |   10 ++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    7 +++++++
 6 files changed, 35 insertions(+), 4 deletions(-)

New commits:
commit 24bd53ea71663bc49881deff6d10baf995dcd232
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Sep 22 08:47:03 2015 +0200

    tdf#92454 DOCX import: allow overriding para prop from num style in para style
    
    Word has a feature like this: a paragraph style can refer to a numbering
    style, and both can specify paragraph margins. If that's the case, then
    the ones from the paragraph style has priority.
    
    In Writer, the numbering style has priority, so the only chance for
    correct import result is to set the margin directly on the paragraph in
    this case.
    
    (cherry picked from commit f4badd9a485f32f787d78431ed673e2932973887)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: Iff3b03bcc56e0db3a48452c293acf41c91b8f159
    Reviewed-on: https://gerrit.libreoffice.org/19100
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf92454.docx b/sw/qa/extras/ooxmlimport/data/tdf92454.docx
new file mode 100644
index 0000000..7042668
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf92454.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index fa8d504..a71c4f9 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2647,6 +2647,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf92454, "tdf92454.docx")
+{
+    // The first paragraph had a large indentation / left margin as inheritance
+    // in Word and Writer works differently, and no direct value was set to be
+    // explicit.
+    uno::Reference<beans::XPropertyState> xParagraph(getParagraph(1), uno::UNO_QUERY);
+    // This was beans::PropertyState_DEFAULT_VALUE.
+    CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index a56fbed..835e973 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2017,6 +2017,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
 
                     rContext->Insert(PROP_PARA_RIGHT_MARGIN, uno::makeAny(nParaRightMargin));
                 }
+
+                // Indent properties from the paragraph style have priority
+                // over the ones from the numbering styles in Word, not in
+                // Writer.
+                boost::optional<PropertyMap::Property> oProperty;
+                if (pStyleSheetProperties && (oProperty = pStyleSheetProperties->getProperty(PROP_PARA_FIRST_LINE_INDENT)))
+                    rContext->Insert(PROP_PARA_FIRST_LINE_INDENT, oProperty->second);
             }
 
             if( pStyleSheetProperties && pStyleSheetProperties->GetListLevel() >= 0 )
commit 89469ff777e4ac5e6cce4bd72c4aef843d0a9255
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 30 12:39:11 2015 +0300

    Probably good to move the more complicates test after the light-weight ones
    
    We will return false if any of the tests here match, so good to test
    the trivial things first before ones involving a potentially complex
    function call.
    
    Change-Id: I531282041c888799d37d95ae773daa349e60a37d

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 0545f56..a64229c 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3775,9 +3775,6 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
 
 bool ScFormulaCell::InterpretFormulaGroup()
 {
-    if (!officecfg::Office::Common::Misc::UseOpenCL::get())
-        return false;
-
     if (!mxGroup || !pCode)
         return false;
 
@@ -3803,6 +3800,9 @@ bool ScFormulaCell::InterpretFormulaGroup()
             return false;
     }
 
+    if (!officecfg::Office::Common::Misc::UseOpenCL::get())
+        return false;
+
     // TODO : Disable invariant formula group interpretation for now in order
     // to get implicit intersection to work.
     if (mxGroup->mbInvariant && false)
commit 6f77377f436a411dcbbf56c538f485427653741a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Sep 15 21:41:48 2015 +0200

    tdf#94173: Calc doesn't save your own created autoformat presets
    
    Auformat list (maData) is defined as "MapType" which itself is defined like this:
    boost::ptr_map<OUString, ScAutoFormatData>
    so default sorting is ascii
    
    2 consequences:
    1) Default didn't appear first
    2) When adding a new autoformat entry when it was new first one of the list
    wasn't saved because of iterator was incremented first before looping
    See https://bugs.documentfoundation.org/show_bug.cgi?id=94173#c5
    There were some other weird behaviors too according to comments of the bugtracker
    
    Regression from http://cgit.freedesktop.org/libreoffice/core/commit/?id=72c1b6141d590fb4479925ed8bc88b79357c2bfc
    
    Solution:
    Add a Compare so Default entry is always first one so the first time incremented iterator is ok and
    new entry (even if new first one in list) is saved
    
    Thank you Markus for the idea! (I was lost in Compare syntax)
    
    Reviewed-on: https://gerrit.libreoffice.org/18598
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 652158c3f2c9cd0d6f71ecd14bf5d5cc02a71b50)
    
    use collator for UI visible sorting, tdf#94173 follow-up
    
    (cherry picked from commit a71febc99d2cfc2fe51dec8c0bca5d84d8577168)
    
    b9f7ebb087c1ce5008f43b2df3f1fadc41066ed1
    
    Change-Id: I9ba0cdc63c66b747db102bb661cd09fbfe5996ae
    Reviewed-on: https://gerrit.libreoffice.org/19029
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/19152

diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx
index 938ef5e..a083116 100644
--- a/sc/inc/autoform.hxx
+++ b/sc/inc/autoform.hxx
@@ -307,9 +307,13 @@ public:
     bool                        Save( SvStream& rStream, sal_uInt16 fileVersion );
 };
 
+struct DefaultFirstEntry {
+    bool operator() (const OUString& left, const OUString& right) const;
+};
+
 class SC_DLLPUBLIC ScAutoFormat
 {
-    typedef boost::ptr_map<OUString, ScAutoFormatData> MapType;
+    typedef boost::ptr_map<OUString, ScAutoFormatData, DefaultFirstEntry> MapType;
     MapType maData;
     bool mbSaveLater;
     ScAfVersions m_aVersions;
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index e9265b9..8309280 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -897,6 +897,16 @@ ScAutoFormat::ScAutoFormat() :
     insert(pData);
 }
 
+bool DefaultFirstEntry::operator() (const OUString& left, const OUString& right) const
+{
+    OUString aStrStandard(ScGlobal::GetRscString(STR_STYLENAME_STANDARD));
+    if ( ScGlobal::GetpTransliteration()->isEqual( left, aStrStandard ) )
+        return true;
+    if ( ScGlobal::GetpTransliteration()->isEqual( right, aStrStandard ) )
+        return false;
+    return ScGlobal::GetCollator()->compareString( left, right) < 0;
+}
+
 ScAutoFormat::ScAutoFormat(const ScAutoFormat& r) :
     maData(r.maData),
     mbSaveLater(false) {}


More information about the Libreoffice-commits mailing list