[libreoffice/f17] Resolves: fdo#58730 fdo#59366

Michael Stahl mstahl at fedoraproject.org
Fri Jan 18 11:55:47 UTC 2013


commit 95a95ca5c3671a63b4442bfaa9d77508e2de2ac5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jan 18 12:55:06 2013 +0100

    Resolves: fdo#58730 fdo#59366
    
    - Resolves: fdo#58730 ODF fo:margin 100% bug
    - Resolves: fdo#59366: Document Conversion wizard: enable "StarOffice"
      again

 ...ocument-Conversion-wizard-enable-StarOffi.patch |   37 +++++++
 ...o-58730-workaround-UL-LR-Space-100-proble.patch |  104 ++++++++++++++++++++
 libreoffice.spec                                   |    6 +
 3 files changed, 147 insertions(+), 0 deletions(-)
---
diff --git a/0001-fdo-59366-Document-Conversion-wizard-enable-StarOffi.patch b/0001-fdo-59366-Document-Conversion-wizard-enable-StarOffi.patch
new file mode 100644
index 0000000..2d1bfa5
--- /dev/null
+++ b/0001-fdo-59366-Document-Conversion-wizard-enable-StarOffi.patch
@@ -0,0 +1,37 @@
+From 2f8f6ef3f8772aad5e7589daffbe91fd4cf9f961 Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl at redhat.com>
+Date: Mon, 14 Jan 2013 17:27:26 +0100
+Subject: [PATCH 1/2] fdo#59366: Document Conversion wizard: enable
+ "StarOffice" again:
+
+The createBF_MigrateFilterIfPossible function does not actually return
+its intended return value, so the dialog never shows the "StarOffice"
+button.
+
+(regression from f3e40273b699910108007faf8a7991fe0498ad97)
+
+Change-Id: I8a72a4e16b23ffda01caf3207127de628afc4036
+Reviewed-on: https://gerrit.libreoffice.org/1677
+Reviewed-by: Noel Power <noel.power at suse.com>
+Tested-by: Noel Power <noel.power at suse.com>
+(cherry picked from commit 959ce73b266d3639ff1ced9cb980adf5fe643ad5)
+---
+ wizards/source/importwizard/Main.xba | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba
+index 7385c6b..fdea2f9 100644
+--- a/wizards/source/importwizard/Main.xba
++++ b/wizards/source/importwizard/Main.xba
+@@ -190,7 +190,7 @@ Function createBF_MigrateFilterIfPossible()
+ Dim oService
+     On Error Goto RTError
+     oService = createUnoService(&quot;com.sun.star.comp.office.BF_MigrateFilter&quot;)
+-    getBinFilterCompIfItExists = oService
++    createBF_MigrateFilterIfPossible = oService
+     Exit Function
+ RTError:
+     createBF_MigrateFilterIfPossible = Nothing
+-- 
+1.7.11.7
+
diff --git a/0002-Resolves-fdo-58730-workaround-UL-LR-Space-100-proble.patch b/0002-Resolves-fdo-58730-workaround-UL-LR-Space-100-proble.patch
new file mode 100644
index 0000000..a7e7524
--- /dev/null
+++ b/0002-Resolves-fdo-58730-workaround-UL-LR-Space-100-proble.patch
@@ -0,0 +1,104 @@
+From 1f04cd4415c88d3bcb27b118fa3121fe58de87db Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Thu, 17 Jan 2013 12:41:11 +0000
+Subject: [PATCH 2/2] Resolves: fdo#58730 workaround [UL|LR]Space 100% problem
+
+If all paragraph margins are 100% on import, ignore that as being the implicit
+default. That avoids explicit 100% being set onto the awesome [UL|LR]Space
+which takes a relative propsize of 100% as a flag that its value field is
+absolute and so rejected by SwTxtFmtColl::Modify as a candidate for getting its
+true value initialized relative to its parent, so it ends up as an absolute 0
+
+Always elide the property on export because writing individual
+margin-foos provides better backward compatibility with older versions
+anyway.
+
+Trigged by 3c5facfce42a0dbe362d6b9fa5ac374fd76f51a1
+
+Change-Id: I55f6ceeae287b7d8e99befa4bd3cc06738a21299
+(cherry picked from commit 23c099a0236062724430efb986251637095c8d4f)
+
+Signed-off-by: Michael Stahl <mstahl at redhat.com>
+(cherry picked from commit abb84c2cce54a903ef846cbfe297b2bbc62ff260)
+---
+ xmloff/source/text/txtexppr.cxx |  8 ++++++++
+ xmloff/source/text/txtimppr.cxx | 23 ++++++++++++++++++++++-
+ 2 files changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
+index 48c2e64..17991ec 100644
+--- a/xmloff/source/text/txtexppr.cxx
++++ b/xmloff/source/text/txtexppr.cxx
+@@ -467,6 +467,8 @@ void XMLTextExportPropertySetMapper::ContextFilter(
+     XMLPropertyState* pClip11State = NULL;
+     XMLPropertyState* pClipState = NULL;
+ 
++    // filter fo:margin
++    XMLPropertyState* pAllParaMarginRel = NULL;
+     XMLPropertyState* pAllParaMargin = NULL;
+     XMLPropertyState* pAllMargin = NULL;
+ 
+@@ -584,6 +586,7 @@ void XMLTextExportPropertySetMapper::ContextFilter(
+         case CTF_NUMBERINGSTYLENAME:    pListStyleName = propertie; break;
+         case CTF_TEXT_CLIP11:           pClip11State = propertie; break;
+         case CTF_TEXT_CLIP:             pClipState = propertie; break;
++        case CTF_PARAMARGINALL_REL:     pAllParaMarginRel = propertie; break;
+         case CTF_PARAMARGINALL:         pAllParaMargin = propertie; break;
+         case CTF_MARGINALL:             pAllMargin = propertie; break;
+         }
+@@ -637,6 +640,11 @@ void XMLTextExportPropertySetMapper::ContextFilter(
+     lcl_checkMultiProperty(pParaBottomMarginState, pParaBottomMarginRelState);
+     lcl_checkMultiProperty(pParaFirstLineState, pParaFirstLineRelState);
+ 
++    if (pAllParaMarginRel)
++    {   // because older OOo/LO versions can't read fo:margin:
++        pAllParaMarginRel->mnIndex = -1; // just export individual attributes...
++        pAllParaMarginRel->maValue.clear();
++    }
+     if (pAllParaMargin)
+     {
+         pAllParaMargin->mnIndex = -1; // just export individual attributes...
+diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
+index 5c63fcb..c403794 100644
+--- a/xmloff/source/text/txtimppr.cxx
++++ b/xmloff/source/text/txtimppr.cxx
+@@ -266,6 +266,26 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
+     }
+ }
+ 
++//fdo#58730 The [UL|LR]Space class has a deficiency where "100%" also serves as
++//a flag that the value is an absolute value so we can't truly handle an
++//up/lower space property which wants to specify its 200% upper but 100% lower
++//of its parent (try typing 100% vs 200% into the edit style dialog and revisit
++//your style). So on xml load that ends up meaning 200%, 0 lower. This is a
++//crock.
++//
++//On import clear 100% all-margins relative sizes.
++static bool
++isNotDefaultRelSize(const XMLPropertyState* pRelState, const UniReference<XMLPropertySetMapper>& rPrMap)
++{
++    if (rPrMap->GetEntryContextId(pRelState->mnIndex) == CTF_PARAMARGINALL_REL)
++    {
++        sal_Int32 nTemp = 0;
++        pRelState->maValue >>= nTemp;
++        return nTemp != 100;
++    }
++    return true;
++}
++
+ void XMLTextImportPropertyMapper::finished(
+             ::std::vector< XMLPropertyState >& rProperties,
+             sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) const
+@@ -434,7 +454,8 @@ void XMLTextImportPropertyMapper::finished(
+ 
+     for (sal_uInt16 i = 0; i < 4; i++)
+     {
+-        if (pAllParaMargin && !pParaMargins[i])
++        if (pAllParaMargin && !pParaMargins[i]
++            && isNotDefaultRelSize(pAllParaMargin, getPropertySetMapper()))
+         {
+ #if OSL_DEBUG_LEVEL > 0
+             sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId(
+-- 
+1.7.11.7
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 76d20de..9c8bb4e 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -175,6 +175,8 @@ Patch57: 0001-fdo-48442-fix-default-hori-vert-frame-anchor-during-.patch
 Patch58: 0002-Resolves-fdo-53909-STG_FREE-sector-locations-rejecte.patch
 Patch59: 0003-Resolves-fdo-57532-restrict-page-sanity-check-to-non.patch
 Patch60: 0001-rhbz-890080-crash-in-SwXTextDocument-getRendererCoun.patch
+Patch61: 0001-fdo-59366-Document-Conversion-wizard-enable-StarOffi.patch
+Patch62: 0002-Resolves-fdo-58730-workaround-UL-LR-Space-100-proble.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1065,6 +1067,8 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch58 -p1 -b .Resolves-fdo-53909-STG_FREE-sector-locations-rejecte.patch
 %patch59 -p1 -b .Resolves-fdo-57532-restrict-page-sanity-check-to-non.patch
 %patch60 -p1 -b .rhbz-890080-crash-in-SwXTextDocument-getRendererCoun.patch
+%patch61 -p1 -b .fdo-59366-Document-Conversion-wizard-enable-StarOffi.patch
+%patch62 -p1 -b .Resolves-fdo-58730-workaround-UL-LR-Space-100-proble.patch
 
 # TODO: check this
 # these are horribly incomplete--empty translations and copied english
@@ -2355,6 +2359,8 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 - Resolves: rhbz#810739 Incorrect displaying attached rtf document
 - Resolves: rhbz#876606 regressions in MSO binary import filters
 - Resolves: rhbz#890080 crash in SwXTextDocument::getRendererCount
+- Resolves: fdo#58730 ODF fo:margin 100% bug
+- Resolves: fdo#59366: Document Conversion wizard: enable "StarOffice" again
 
 * Thu Dec 06 2012 Stephan Bergmann <sbergman at redhat.com> - 1:3.5.7.2-7
 - Resolves: rendering documents in browser plug-in


More information about the scm-commits mailing list