[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - configmgr/source sw/qa writerfilter/source

Mike Kaganski mike.kaganski at collabora.com
Fri Apr 27 09:17:36 UTC 2018


 configmgr/source/winreg.cxx                    |   17 ++++++++++++++---
 sw/qa/extras/rtfimport/data/tdf117246.rtf      |   11 +++++++++++
 sw/qa/extras/rtfimport/rtfimport.cxx           |    6 ++++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    9 +++++++++
 4 files changed, 40 insertions(+), 3 deletions(-)

New commits:
commit ca5a44a9f765ca8f968e283b068be6e92f2ab394
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Apr 24 16:01:56 2018 +0100

    Winreg config layer: Allow to define external backend separately
    
    Defining backend separately allows e.g. creating ADMX templates with
    easy-to-use UI, where user defines only LDAP names for the setting, and
    doesn't need to type the LO configuration backend name.
    
    Change-Id: I64f23043c94a5a4e0ba7281d0f711a427d694126
    Reviewed-on: https://gerrit.libreoffice.org/53413
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 8776a895d41f174bf5d86332093ed5795c73bdd6)
    Reviewed-on: https://gerrit.libreoffice.org/53436
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index be625eb99283..b4c2cf0fb06c 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -37,7 +37,7 @@ namespace {
 // Last element of Key becomes prop, first part is the path and optionally nodes,
 // when the node has oor:op attribute.
 // Values can be the following: Value (string), Type (string, optional),
-// Final (dword, optional), External (dword, optional)
+// Final (dword, optional), External (dword, optional), ExternalBackend (string, optional)
 //
 // For example the following registry setting:
 // [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
@@ -82,9 +82,10 @@ namespace {
 //
 // External (component data) example:
 // [HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
-// "Value"="com.sun.star.configuration.backend.LdapUserProfileBe company"
+// "Value"="company"
 // "Final"=dword:00000001
 // "External"=dword:00000001
+// "ExternalBackend"="com.sun.star.configuration.backend.LdapUserProfileBe"
 // becomes the following in configuration:
 // <item oor:path="/org.openoffice.UserProfile/Data">
 //     <prop oor:name="o" oor:finalized="true">
@@ -135,6 +136,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil
             bool bExternal = false;
             OUString aValue;
             OUString aType;
+            OUString aExternalBackend;
 
             for(DWORD i = 0; i < nValues; ++i)
             {
@@ -157,11 +159,20 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil
                     if (*reinterpret_cast<DWORD*>(pValue) == 1)
                         bExternal = true;
                 }
+                else if (!wcscmp(pValueName, L"ExternalBackend"))
+                    aExternalBackend = OUString(pValue);
             }
-            // type and external are mutually exclusive
             if (bExternal)
+            {
+                // type and external are mutually exclusive
                 aType.clear();
 
+                // Prepend backend, like in
+                // "com.sun.star.configuration.backend.LdapUserProfileBe company"
+                if (!aExternalBackend.isEmpty())
+                    aValue = aExternalBackend + " " + aValue;
+            }
+
             sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
             OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
             OUString aProp = aKeyName.copy(aLastSeparator + 1);
commit ed002d7b8de39de81ccd016bc40841b8d2a132dc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Apr 26 12:03:12 2018 +0200

    tdf#117246 RTF import: don't loose page breaks inside nested groups
    
    Regression from e3f254ab8211fbab7541cde2100a35c875b0c240 (RTF import:
    fix spurious page breaks at doc end (related: rhbz#1065629),
    2014-02-27), the problem was that now we update the parser state to
    remember the next section break should set the break type of the current
    section to "next page", but this state should be remembered once the RTF
    group ends ("}" character), otherwise \page will be represented with a
    continuous break, i.e. lost.
    
    (cherry picked from commit 4a93b46e4652e73ed3460e4c66999d94e50db4b7)
    
    Conflicts:
            sw/qa/extras/rtfimport/rtfimport.cxx
    
    Change-Id: I69a8413f45e17e11d6d676c7bfd13ca7560b4d43
    Reviewed-on: https://gerrit.libreoffice.org/53510
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/qa/extras/rtfimport/data/tdf117246.rtf b/sw/qa/extras/rtfimport/data/tdf117246.rtf
new file mode 100644
index 000000000000..a6fc7cf94426
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf117246.rtf
@@ -0,0 +1,11 @@
+{\rtf1
+\sbknone\pard\plain
+{Page 1}
+{\par }
+{\page }
+{Page 2}
+{\par }
+{\page }
+{Page 3}
+{\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 18730e123084..5c7f39db475a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -211,6 +211,12 @@ DECLARE_RTFIMPORT_TEST(testN695479, "n695479.rtf")
     CPPUNIT_ASSERT(bDrawFound);
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf117246, "tdf117246.rtf")
+{
+    // This was 2, all but the last \page was lost.
+    CPPUNIT_ASSERT_EQUAL(3, getPages());
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo42465, "fdo42465.rtf")
 {
     CPPUNIT_ASSERT_EQUAL(3, getLength());
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 713cd3874d15..afc3bec2dc8b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3072,6 +3072,15 @@ RTFError RTFDocumentImpl::popState()
         // don't do it again in the outer state later.
         m_aStates.top().nTableRowWidthAfter = 0;
 
+    if (m_nResetBreakOnSectBreak != RTF_invalid && !m_aStates.empty())
+    {
+        // Section break type created for \page still has an effect in the
+        // outer state as well.
+        RTFValue::Pointer_t pType = aState.aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
+        if (pType)
+            m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_type, pType);
+    }
+
     return RTFError::OK;
 }
 


More information about the Libreoffice-commits mailing list