diff options
-rw-r--r-- | sw/inc/unoprnms.hxx | 52 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 66 |
3 files changed, 129 insertions, 0 deletions
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index e4d24cd0c6ee..0678dee38190 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -608,7 +608,59 @@ #define UNO_NAME_SW_FILLTRANSPARENCEGRADIENTNAME UNO_NAME_FILLTRANSPARENCEGRADIENTNAME #define UNO_NAME_SW_FILLCOLOR_2 UNO_NAME_FILLCOLOR_2 +#define UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE "HeaderFillBitmapLogicalSize" +#define UNO_NAME_HEADER_FILLBMP_OFFSET_X "HeaderFillBitmapOffsetX" +#define UNO_NAME_HEADER_FILLBMP_OFFSET_Y "HeaderFillBitmapOffsetY" +#define UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X "HeaderFillBitmapPositionOffsetX" +#define UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y "HeaderFillBitmapPositionOffsetY" +#define UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT "HeaderFillBitmapRectanglePoint" +#define UNO_NAME_HEADER_FILLBMP_SIZE_X "HeaderFillBitmapSizeX" +#define UNO_NAME_HEADER_FILLBMP_SIZE_Y "HeaderFillBitmapSizeY" +#define UNO_NAME_HEADER_FILLBMP_STRETCH "HeaderFillBitmapStretch" +#define UNO_NAME_HEADER_FILLBMP_TILE "HeaderFillBitmapTile" +#define UNO_NAME_HEADER_FILLBMP_MODE "HeaderFillBitmapMode" +#define UNO_NAME_HEADER_FILLCOLOR "HeaderFillColor" +#define UNO_NAME_HEADER_FILLBACKGROUND "HeaderFillBackground" +#define UNO_NAME_HEADER_FILLBITMAP "HeaderFillBitmap" +#define UNO_NAME_HEADER_FILLBITMAPNAME "HeaderFillBitmapName" +#define UNO_NAME_HEADER_FILLBITMAPURL "HeaderFillBitmapURL" +#define UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT "HeaderFillGradientStepCount" +#define UNO_NAME_HEADER_FILLGRADIENT "HeaderFillGradient" +#define UNO_NAME_HEADER_FILLGRADIENTNAME "HeaderFillGradientName" +#define UNO_NAME_HEADER_FILLHATCH "HeaderFillHatch" +#define UNO_NAME_HEADER_FILLHATCHNAME "HeaderFillHatchName" +#define UNO_NAME_HEADER_FILLSTYLE "HeaderFillStyle" +#define UNO_NAME_HEADER_FILL_TRANSPARENCE "HeaderFillTransparence" +#define UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENT "HeaderFillTransparenceGradient" +#define UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENTNAME "HeaderFillTransparenceGradientName" +#define UNO_NAME_HEADER_FILLCOLOR_2 "HeaderFillColor2" +#define UNO_NAME_FOOTER_FILLBMP_LOGICAL_SIZE "FooterFillBitmapLogicalSize" +#define UNO_NAME_FOOTER_FILLBMP_OFFSET_X "FooterFillBitmapOffsetX" +#define UNO_NAME_FOOTER_FILLBMP_OFFSET_Y "FooterFillBitmapOffsetY" +#define UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_X "FooterFillBitmapPositionOffsetX" +#define UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_Y "FooterFillBitmapPositionOffsetY" +#define UNO_NAME_FOOTER_FILLBMP_RECTANGLE_POINT "FooterFillBitmapRectanglePoint" +#define UNO_NAME_FOOTER_FILLBMP_SIZE_X "FooterFillBitmapSizeX" +#define UNO_NAME_FOOTER_FILLBMP_SIZE_Y "FooterFillBitmapSizeY" +#define UNO_NAME_FOOTER_FILLBMP_STRETCH "FooterFillBitmapStretch" +#define UNO_NAME_FOOTER_FILLBMP_TILE "FooterFillBitmapTile" +#define UNO_NAME_FOOTER_FILLBMP_MODE "FooterFillBitmapMode" +#define UNO_NAME_FOOTER_FILLCOLOR "FooterFillColor" +#define UNO_NAME_FOOTER_FILLBACKGROUND "FooterFillBackground" +#define UNO_NAME_FOOTER_FILLBITMAP "FooterFillBitmap" +#define UNO_NAME_FOOTER_FILLBITMAPNAME "FooterFillBitmapName" +#define UNO_NAME_FOOTER_FILLBITMAPURL "FooterFillBitmapURL" +#define UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT "FooterFillGradientStepCount" +#define UNO_NAME_FOOTER_FILLGRADIENT "FooterFillGradient" +#define UNO_NAME_FOOTER_FILLGRADIENTNAME "FooterFillGradientName" +#define UNO_NAME_FOOTER_FILLHATCH "FooterFillHatch" +#define UNO_NAME_FOOTER_FILLHATCHNAME "FooterFillHatchName" +#define UNO_NAME_FOOTER_FILLSTYLE "FooterFillStyle" +#define UNO_NAME_FOOTER_FILL_TRANSPARENCE "FooterFillTransparence" +#define UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENT "FooterFillTransparenceGradient" +#define UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENTNAME "FooterFillTransparenceGradientName" +#define UNO_NAME_FOOTER_FILLCOLOR_2 "FooterFillColor2" #define UNO_NAME_PARA_STYLEHEADING "ParaStyleHeading" #define UNO_NAME_PARA_STYLELEVEL1 "ParaStyleLevel1" diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index a8a374246792..f967f3414a00 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -12,6 +12,8 @@ #if !defined(WNT) #include <com/sun/star/awt/FontWeight.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/table/XCell.hpp> #include <com/sun/star/table/BorderLine.hpp> @@ -307,6 +309,15 @@ DECLARE_ODFIMPORT_TEST(testFdo79269_header, "fdo79269_header.odt") CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString()); } +DECLARE_ODFIMPORT_TEST(testPageBackground, "PageBackground.odt") +{ + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default Style"), uno::UNO_QUERY); + // The background image was lost + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_BITMAP, getProperty<drawing::FillStyle>(xPropertySet, "FillStyle")); + CPPUNIT_ASSERT_EQUAL(OUString("Sky"), getProperty<OUString>(xPropertySet, "FillBitmapName")); + CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_REPEAT, getProperty<drawing::BitmapMode>(xPropertySet, "FillBitmapMode")); +} + DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 3bd2700efe40..0fa0229573b1 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1070,6 +1070,72 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_GRID_SNAP_TO_CHARS), RES_TEXTGRID, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_GRID_SNAPTOCHARS}, { OUString(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_GRID_STANDARD_MODE}, { OUString(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, + + //UUUU added FillProperties for SW, same as FILL_PROPERTIES in svx + // but need own defines in Writer due to later association of strings + // and uno types (see loop at end of this method and definition of SW_PROP_NMID) + // This entry is for adding that properties to style import/export + FILL_PROPERTIES_SW + + //UUUU Added DrawingLayer FillStyle Properties for Header. These need an own unique name, + // but reuse the same WhichIDs as the regular fill. The implementation will decide to which + // group of fill properties it belongs based on the start of the name (was already done in + // the implementation partially), thus all SlotNames *have* to start with 'Header' + { OUString(UNO_NAME_HEADER_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, cppu::UnoType<css::drawing::RectanglePoint>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, cppu::UnoType<sal_Int32>::get() , 0, SFX_METRIC_ITEM}, + { OUString(UNO_NAME_HEADER_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, cppu::UnoType<sal_Int32>::get() , 0, SFX_METRIC_ITEM}, + { OUString(UNO_NAME_HEADER_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_TILE), XATTR_FILLBMP_TILE, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, cppu::UnoType<css::drawing::BitmapMode>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILLCOLOR), XATTR_FILLCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBACKGROUND), XATTR_FILLBACKGROUND, cppu::UnoType<bool>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILLBITMAP), XATTR_FILLBITMAP, cppu::UnoType<css::awt::XBitmap>::get(), 0, MID_BITMAP}, + { OUString(UNO_NAME_HEADER_FILLBITMAPNAME), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_HEADER_FILLBITMAPURL), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_GRAFURL }, + { OUString(UNO_NAME_HEADER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, cppu::UnoType<sal_Int16>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILLGRADIENT), XATTR_FILLGRADIENT, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT}, + { OUString(UNO_NAME_HEADER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_HEADER_FILLHATCH), XATTR_FILLHATCH, cppu::UnoType<css::drawing::Hatch>::get(), 0, MID_FILLHATCH}, + { OUString(UNO_NAME_HEADER_FILLHATCHNAME), XATTR_FILLHATCH, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_HEADER_FILLSTYLE), XATTR_FILLSTYLE, cppu::UnoType<css::drawing::FillStyle>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, cppu::UnoType<sal_Int16>::get(), 0, 0}, + { OUString(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT}, + { OUString(UNO_NAME_HEADER_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_HEADER_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0}, + + //UUUU Added DrawingLayer FillStyle Properties for Footer, similar as for Header (see there) + { OUString(UNO_NAME_FOOTER_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, cppu::UnoType<sal_Int32>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, cppu::UnoType<css::drawing::RectanglePoint>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, cppu::UnoType<sal_Int32>::get() , 0, SFX_METRIC_ITEM}, + { OUString(UNO_NAME_FOOTER_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, cppu::UnoType<sal_Int32>::get() , 0, SFX_METRIC_ITEM}, + { OUString(UNO_NAME_FOOTER_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_TILE), XATTR_FILLBMP_TILE, cppu::UnoType<bool>::get() , 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, cppu::UnoType<css::drawing::BitmapMode>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLCOLOR), XATTR_FILLCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBACKGROUND), XATTR_FILLBACKGROUND, cppu::UnoType<bool>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLBITMAP), XATTR_FILLBITMAP, cppu::UnoType<css::awt::XBitmap>::get(), 0, MID_BITMAP}, + { OUString(UNO_NAME_FOOTER_FILLBITMAPNAME), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_FOOTER_FILLBITMAPURL), XATTR_FILLBITMAP, cppu::UnoType<OUString>::get(), 0, MID_GRAFURL }, + { OUString(UNO_NAME_FOOTER_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT, cppu::UnoType<sal_Int16>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLGRADIENT), XATTR_FILLGRADIENT, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT}, + { OUString(UNO_NAME_FOOTER_FILLGRADIENTNAME), XATTR_FILLGRADIENT, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_FOOTER_FILLHATCH), XATTR_FILLHATCH, cppu::UnoType<css::drawing::Hatch>::get(), 0, MID_FILLHATCH}, + { OUString(UNO_NAME_FOOTER_FILLHATCHNAME), XATTR_FILLHATCH, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_FOOTER_FILLSTYLE), XATTR_FILLSTYLE, cppu::UnoType<css::drawing::FillStyle>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, cppu::UnoType<sal_Int16>::get(), 0, 0}, + { OUString(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<css::awt::Gradient>::get(), 0, MID_FILLGRADIENT}, + { OUString(UNO_NAME_FOOTER_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, cppu::UnoType<OUString>::get(), 0, MID_NAME }, + { OUString(UNO_NAME_FOOTER_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, cppu::UnoType<sal_Int32>::get(), 0, 0}, + { OUString(), 0, css::uno::Type(), 0, 0 } }; aMapEntriesArr[nPropertyId] = aPageStyleMap; |