Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

See
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4ac48167662c592c21025b89fe8f6925c680c6e0
http://cgit.freedesktop.org/libreoffice/core/commit/?id=c306532e0bed1df36abf5d7ad6f0363056e69739

Attached a backport of these commits to -3-5.

Thanks,

Miklos
From e0c37573ebaedeb785b9f0df1ab8d4459abbab78 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@suse.cz>
Date: Mon, 20 Feb 2012 15:46:08 +0100
Subject: [PATCH] n#695479 fix rtf/docx import of transparent frames

Previously all frames were opaque by default, which is the Writer but
not the docx/rtf default. Change the default, while keeping the
possibility to set an opaque color background for the frame.

(cherry picked from commits 4ac48167662c592c21025b89fe8f6925c680c6e0 and
c306532e0bed1df36abf5d7ad6f0363056e69739)
---
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    7 ++++++-
 writerfilter/source/dmapper/PropertyIds.cxx       |    1 +
 writerfilter/source/dmapper/PropertyIds.hxx       |    1 +
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d36fda0..bc38966 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -702,7 +702,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
             StyleSheetEntryPtr pParaStyle =
                 
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(rAppendContext.pLastParagraphProperties->GetParaStyleName());
 
-            uno::Sequence< beans::PropertyValue > aFrameProperties(pParaStyle ? 15: 9);
+            uno::Sequence< beans::PropertyValue > aFrameProperties(pParaStyle ? 16: 9);
 
             if ( pParaStyle.get( ) )
             {
@@ -722,6 +722,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
                 pFrameProperties[12].Name = rPropNameSupplier.GetName(PROP_RIGHT_MARGIN);
                 pFrameProperties[13].Name = rPropNameSupplier.GetName(PROP_TOP_MARGIN);
                 pFrameProperties[14].Name = rPropNameSupplier.GetName(PROP_BOTTOM_MARGIN);
+                pFrameProperties[15].Name = 
rPropNameSupplier.GetName(PROP_BACK_COLOR_TRANSPARENCY);
 
                 const ParagraphProperties* pStyleProperties = dynamic_cast<const 
ParagraphProperties*>( pParaStyle->pProperties.get() );
                 sal_Int32 nWidth =
@@ -794,6 +795,10 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
                 pStyleProperties->GetvSpace() >= 0 ? pStyleProperties->GetvSpace() : 0;
                 pFrameProperties[13].Value <<= nHoriOrient == text::HoriOrientation::LEFT ? 0 : 
nLeftDist;
                 pFrameProperties[14].Value <<= nHoriOrient == text::HoriOrientation::RIGHT ? 0 : 
nRightDist;
+                // If there is no fill, the Word default is 100% transparency.
+                // Otherwise CellColorHandler has priority, and this setting
+                // will be ignored.
+                pFrameProperties[15].Value <<= sal_Int32(100);
 
                 lcl_MoveBorderPropertiesToFrame(aFrameProperties,
                     rAppendContext.pLastParagraphProperties->GetStartingRange(),
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx 
b/writerfilter/source/dmapper/PropertyIds.cxx
index 173be40..c8f8a55 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -196,6 +196,7 @@ const rtl::OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const
             case PROP_CONTOUR_POLY_POLYGON :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContourPolyPolygon")); break;
             case PROP_PAGE_TOGGLE          :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageToggle")); break;
             case PROP_BACK_COLOR           :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackColor")); break;
+            case PROP_BACK_COLOR_TRANSPARENCY:  sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackColorTransparency")); break;
             case PROP_ALTERNATIVE_TEXT     :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")); break;
             case PROP_HEADER_TEXT_LEFT     :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderTextLeft")); break;
             case PROP_HEADER_TEXT          :    sName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderText")); break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx 
b/writerfilter/source/dmapper/PropertyIds.hxx
index dd20f06..b109cd6 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -51,6 +51,7 @@ enum PropertyIds
         ,PROP_ANCHOR_TYPE
         ,PROP_AUTOMATIC_DISTANCE
         ,PROP_BACK_COLOR
+        ,PROP_BACK_COLOR_TRANSPARENCY
         ,PROP_BITMAP
         ,PROP_BOTTOM_BORDER
         ,PROP_BOTTOM_BORDER_DISTANCE
-- 
1.7.7


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.