Kaydet (Commit) 4ac48167 authored tarafından Miklos Vajna's avatar Miklos Vajna

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.
üst 7794baf8
...@@ -703,7 +703,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) ...@@ -703,7 +703,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
StyleSheetEntryPtr pParaStyle = StyleSheetEntryPtr pParaStyle =
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(rAppendContext.pLastParagraphProperties->GetParaStyleName()); GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(rAppendContext.pLastParagraphProperties->GetParaStyleName());
uno::Sequence< beans::PropertyValue > aFrameProperties(pParaStyle ? 15: 9); uno::Sequence< beans::PropertyValue > aFrameProperties(pParaStyle ? 16: 9);
if ( pParaStyle.get( ) ) if ( pParaStyle.get( ) )
{ {
...@@ -723,6 +723,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) ...@@ -723,6 +723,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pFrameProperties[12].Name = rPropNameSupplier.GetName(PROP_RIGHT_MARGIN); pFrameProperties[12].Name = rPropNameSupplier.GetName(PROP_RIGHT_MARGIN);
pFrameProperties[13].Name = rPropNameSupplier.GetName(PROP_TOP_MARGIN); pFrameProperties[13].Name = rPropNameSupplier.GetName(PROP_TOP_MARGIN);
pFrameProperties[14].Name = rPropNameSupplier.GetName(PROP_BOTTOM_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() ); const ParagraphProperties* pStyleProperties = dynamic_cast<const ParagraphProperties*>( pParaStyle->pProperties.get() );
sal_Int32 nWidth = sal_Int32 nWidth =
...@@ -795,6 +796,10 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) ...@@ -795,6 +796,10 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pStyleProperties->GetvSpace() >= 0 ? pStyleProperties->GetvSpace() : 0; pStyleProperties->GetvSpace() >= 0 ? pStyleProperties->GetvSpace() : 0;
pFrameProperties[13].Value <<= nHoriOrient == text::HoriOrientation::LEFT ? 0 : nLeftDist; pFrameProperties[13].Value <<= nHoriOrient == text::HoriOrientation::LEFT ? 0 : nLeftDist;
pFrameProperties[14].Value <<= nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nRightDist; 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 <<= 100;
lcl_MoveBorderPropertiesToFrame(aFrameProperties, lcl_MoveBorderPropertiesToFrame(aFrameProperties,
rAppendContext.pLastParagraphProperties->GetStartingRange(), rAppendContext.pLastParagraphProperties->GetStartingRange(),
......
...@@ -196,6 +196,7 @@ const rtl::OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const ...@@ -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_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_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 : 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_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_LEFT : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderTextLeft")); break;
case PROP_HEADER_TEXT : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderText")); break; case PROP_HEADER_TEXT : sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderText")); break;
......
...@@ -51,6 +51,7 @@ enum PropertyIds ...@@ -51,6 +51,7 @@ enum PropertyIds
,PROP_ANCHOR_TYPE ,PROP_ANCHOR_TYPE
,PROP_AUTOMATIC_DISTANCE ,PROP_AUTOMATIC_DISTANCE
,PROP_BACK_COLOR ,PROP_BACK_COLOR
,PROP_BACK_COLOR_TRANSPARENCY
,PROP_BITMAP ,PROP_BITMAP
,PROP_BOTTOM_BORDER ,PROP_BOTTOM_BORDER
,PROP_BOTTOM_BORDER_DISTANCE ,PROP_BOTTOM_BORDER_DISTANCE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment