diff options
author | Jakub Trzebiatowski <ubap.dev@gmail.com> | 2016-07-11 15:51:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-07-13 11:38:01 +0000 |
commit | 50a6f3d51f32e7176c3b2d036c60bb48d51d6a1a (patch) | |
tree | 82f612cf9b1c55c64c9f52c8dd9bf07535efdc84 /sw | |
parent | 380b2d2e449eee1e794efa1b16b69289419a9a66 (diff) |
GSoC Writer Table Styles export of paragraph and char properties
+ Export of paragraph and character properties
+ Tests
Change-Id: I689deb2c524fdcd462c69a33ad9bc2865890793d
Reviewed-on: https://gerrit.libreoffice.org/27115
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/odfexport/data/table_styles_2.odt | bin | 0 -> 10727 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 208 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 50 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 238 |
4 files changed, 496 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/table_styles_2.odt b/sw/qa/extras/odfexport/data/table_styles_2.odt Binary files differnew file mode 100644 index 000000000000..735ea4431909 --- /dev/null +++ b/sw/qa/extras/odfexport/data/table_styles_2.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 313d2cfd39e8..fc8fd71e6ed7 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -12,6 +12,7 @@ #include <initializer_list> #if !defined(MACOSX) +#include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/drawing/FillStyle.hpp> @@ -856,6 +857,213 @@ DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(0), oBorder.Color); } +DECLARE_ODFEXPORT_TEST(testTableStyles2, "table_styles_2.odt") +{ + // Table styles paragraph and char tests + // Doesn't cover all attributes. + // Problem: underline for table autoformat doesn't work. + uno::Reference<style::XStyleFamiliesSupplier> XFamiliesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xFamilies(XFamiliesSupplier->getStyleFamilies()); + uno::Reference<container::XNameAccess> xTableFamily(xFamilies->getByName("TableStyles"), uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xTableStyle(xTableFamily->getByName("Test style2"), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xCell1Style; + + float fFloat = 0.; + bool bBool = true; + sal_Int16 nInt16 = 0xF0; + sal_Int32 nInt32 = 0xF0F0F0; + sal_Int64 nInt64 = 0xF0F0F0; + OUString sString; + awt::FontSlant eCharPosture; + + // cell 1 + xTableStyle->getByName("first-row-start-column") >>= xCell1Style; + xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nInt32); + xCell1Style->getPropertyValue("CharColor") >>= nInt64; + CPPUNIT_ASSERT_EQUAL(sal_Int64(0xFF6600), nInt64); + xCell1Style->getPropertyValue("CharContoured") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(false), bBool); + xCell1Style->getPropertyValue("CharShadowed") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(true), bBool); + xCell1Style->getPropertyValue("CharStrikeout") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nInt32); + xCell1Style->getPropertyValue("CharUnderline") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nInt32); + // underline color is not working for table autoformats + // xCell1Style->getPropertyValue("CharUnderlineHasColor") >>= bBool; + // CPPUNIT_ASSERT_EQUAL(bool(false), bBool); + // xCell1Style->getPropertyValue("CharUnderlineColor") >>= nInt64; + // CPPUNIT_ASSERT_EQUAL(sal_Int64(-1), nInt64); + // standard font + xCell1Style->getPropertyValue("CharHeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(18.), fFloat); + xCell1Style->getPropertyValue("CharWeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPosture") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Courier"), sString); + xCell1Style->getPropertyValue("CharFontStyleName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString(""), sString); + xCell1Style->getPropertyValue("CharFontFamily") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + xCell1Style->getPropertyValue("CharFontPitch") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nInt16); + // cjk font + xCell1Style->getPropertyValue("CharHeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(18.), fFloat); + xCell1Style->getPropertyValue("CharWeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPostureAsian") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Courier"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Regularna"), sString); + xCell1Style->getPropertyValue("CharFontFamilyAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + xCell1Style->getPropertyValue("CharFontPitchAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nInt16); + // ctl font + xCell1Style->getPropertyValue("CharHeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(18.), fFloat); + xCell1Style->getPropertyValue("CharWeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPostureComplex") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Courier"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Regularna"), sString); + xCell1Style->getPropertyValue("CharFontFamilyComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + xCell1Style->getPropertyValue("CharFontPitchComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nInt16); + + // cell 2 + xTableStyle->getByName("first-row") >>= xCell1Style; + xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nInt32); + xCell1Style->getPropertyValue("CharColor") >>= nInt64; + CPPUNIT_ASSERT_EQUAL(sal_Int64(0x9900FF), nInt64); + xCell1Style->getPropertyValue("CharContoured") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(true), bBool); + xCell1Style->getPropertyValue("CharShadowed") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(false), bBool); + xCell1Style->getPropertyValue("CharStrikeout") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nInt32); + xCell1Style->getPropertyValue("CharUnderline") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nInt32); + // underline color test place + // standard font + xCell1Style->getPropertyValue("CharHeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(150.), fFloat); + xCell1Style->getPropertyValue("CharPosture") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Liberation Serif"), sString); + xCell1Style->getPropertyValue("CharFontStyleName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString(""), sString); + xCell1Style->getPropertyValue("CharFontFamily") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(3), nInt16); + xCell1Style->getPropertyValue("CharFontPitch") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + // cjk font + xCell1Style->getPropertyValue("CharHeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(150.), fFloat); + xCell1Style->getPropertyValue("CharPostureAsian") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Liberation Serif"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Pogrubiona"), sString); + xCell1Style->getPropertyValue("CharFontFamilyAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(3), nInt16); + xCell1Style->getPropertyValue("CharFontPitchAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + // ctl font + xCell1Style->getPropertyValue("CharHeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(150.), fFloat); + xCell1Style->getPropertyValue("CharPostureComplex") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_NONE), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Liberation Serif"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Pogrubiona"), sString); + xCell1Style->getPropertyValue("CharFontFamilyComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(3), nInt16); + xCell1Style->getPropertyValue("CharFontPitchComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + + // cell 3 + xTableStyle->getByName("first-row-even-column") >>= xCell1Style; + xCell1Style->getPropertyValue("ParaAdjust") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nInt32); + xCell1Style->getPropertyValue("CharColor") >>= nInt64; + CPPUNIT_ASSERT_EQUAL(sal_Int64(0), nInt64); + xCell1Style->getPropertyValue("CharContoured") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(true), bBool); + xCell1Style->getPropertyValue("CharShadowed") >>= bBool; + CPPUNIT_ASSERT_EQUAL(bool(true), bBool); + xCell1Style->getPropertyValue("CharStrikeout") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nInt32); + xCell1Style->getPropertyValue("CharUnderline") >>= nInt32; + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), nInt32); + // underline color test place + // standard font + xCell1Style->getPropertyValue("CharHeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeight") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPosture") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_ITALIC), eCharPosture); + xCell1Style->getPropertyValue("CharFontName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Open Sans"), sString); + xCell1Style->getPropertyValue("CharFontStyleName") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString(""), sString); + xCell1Style->getPropertyValue("CharFontFamily") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nInt16); + xCell1Style->getPropertyValue("CharFontPitch") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + // cjk font + xCell1Style->getPropertyValue("CharHeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeightAsian") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPostureAsian") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_ITALIC), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Open Sans"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameAsian") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Kursywa"), sString); + xCell1Style->getPropertyValue("CharFontFamilyAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nInt16); + xCell1Style->getPropertyValue("CharFontPitchAsian") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); + // ctl font + xCell1Style->getPropertyValue("CharHeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(12.), fFloat); + xCell1Style->getPropertyValue("CharWeightComplex") >>= fFloat; + CPPUNIT_ASSERT_EQUAL(float(100.), fFloat); + xCell1Style->getPropertyValue("CharPostureComplex") >>= eCharPosture; + CPPUNIT_ASSERT_EQUAL(awt::FontSlant(awt::FontSlant_ITALIC), eCharPosture); + xCell1Style->getPropertyValue("CharFontNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Open Sans"), sString); + xCell1Style->getPropertyValue("CharFontStyleNameComplex") >>= sString; + CPPUNIT_ASSERT_EQUAL(OUString("Kursywa"), sString); + xCell1Style->getPropertyValue("CharFontFamilyComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nInt16); + xCell1Style->getPropertyValue("CharFontPitchComplex") >>= nInt16; + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 7fe145dd08d8..aa98dbbf7ab9 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1505,7 +1505,9 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { static SfxItemPropertyMapEntry const aCellStyleMap[] = { + // SvxBrushItem { OUString(UNO_NAME_BACK_COLOR), RES_BACKGROUND, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0 }, + // SvxBoxItem { OUString(UNO_NAME_LEFT_BORDER), RES_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, LEFT_BORDER|CONVERT_TWIPS }, { OUString(UNO_NAME_RIGHT_BORDER), RES_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, RIGHT_BORDER|CONVERT_TWIPS }, { OUString(UNO_NAME_TOP_BORDER), RES_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, TOP_BORDER|CONVERT_TWIPS }, @@ -1515,9 +1517,57 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { OUString(UNO_NAME_RIGHT_BORDER_DISTANCE), RES_BOX, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS }, { OUString(UNO_NAME_TOP_BORDER_DISTANCE), RES_BOX, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, TOP_BORDER_DISTANCE |CONVERT_TWIPS }, { OUString(UNO_NAME_BOTTOM_BORDER_DISTANCE), RES_BOX, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS }, + // SwFormatVertOrient { OUString(UNO_NAME_VERT_ORIENT), RES_VERT_ORIENT, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_VERTORIENT_ORIENT }, + // SvxFrameDirectionItem { OUString(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 }, + // SvNumberformat { OUString(UNO_NAME_NUMBER_FORMAT), RES_BOXATR_FORMAT, cppu::UnoType<sal_Int32>::get(),PropertyAttribute::MAYBEVOID, 0 }, + // SvxAdjustItem + { OUString(UNO_NAME_PARA_ADJUST), RES_PARATR_ADJUST, cppu::UnoType<sal_Int16>::get(),PropertyAttribute::MAYBEVOID, MID_PARA_ADJUST }, + // SvxColorItem + { OUString(UNO_NAME_CHAR_COLOR), RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0 }, + // SvxShadowedItem + { OUString(UNO_NAME_CHAR_SHADOWED), RES_CHRATR_SHADOWED, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 }, + // SvxContouredItem + { OUString(UNO_NAME_CHAR_CONTOURED), RES_CHRATR_CONTOUR, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 }, + // SvxCrossedOutItem + { OUString(UNO_NAME_CHAR_STRIKEOUT), RES_CHRATR_CROSSEDOUT, cppu::UnoType<sal_Int16>::get(),PropertyAttribute::MAYBEVOID, MID_CROSS_OUT }, + // SvxUnderlineItem + { OUString(UNO_NAME_CHAR_UNDERLINE), RES_CHRATR_UNDERLINE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_TL_STYLE }, + { OUString(UNO_NAME_CHAR_UNDERLINE_COLOR), RES_CHRATR_UNDERLINE,cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_TL_COLOR }, + { OUString(UNO_NAME_CHAR_UNDERLINE_HAS_COLOR), RES_CHRATR_UNDERLINE, cppu::UnoType<bool>::get(), PROPERTY_NONE, MID_TL_HASCOLOR }, + // standard font + // SvxFontHeightItem + { OUString(UNO_NAME_CHAR_HEIGHT), RES_CHRATR_FONTSIZE, cppu::UnoType<float>::get(),PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS }, + // SvxWeightItem + { OUString(UNO_NAME_CHAR_WEIGHT), RES_CHRATR_WEIGHT, cppu::UnoType<float>::get(),PropertyAttribute::MAYBEVOID, MID_WEIGHT }, + // SvxPostureItem + { OUString(UNO_NAME_CHAR_POSTURE), RES_CHRATR_POSTURE, cppu::UnoType<css::awt::FontSlant>::get(),PropertyAttribute::MAYBEVOID, MID_POSTURE }, + // SvxFontItem + { OUString(UNO_NAME_CHAR_FONT_NAME), RES_CHRATR_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY_NAME }, + { OUString(UNO_NAME_CHAR_FONT_STYLE_NAME), RES_CHRATR_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_STYLE_NAME }, + { OUString(UNO_NAME_CHAR_FONT_FAMILY), RES_CHRATR_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY }, + { OUString(UNO_NAME_CHAR_FONT_CHAR_SET), RES_CHRATR_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_CHAR_SET }, + { OUString(UNO_NAME_CHAR_FONT_PITCH), RES_CHRATR_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_PITCH }, + // cjk font + { OUString(UNO_NAME_CHAR_HEIGHT_ASIAN), RES_CHRATR_CJK_FONTSIZE, cppu::UnoType<float>::get(), PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS }, + { OUString(UNO_NAME_CHAR_WEIGHT_ASIAN), RES_CHRATR_CJK_WEIGHT, cppu::UnoType<float>::get(), PropertyAttribute::MAYBEVOID, MID_WEIGHT }, + { OUString(UNO_NAME_CHAR_POSTURE_ASIAN), RES_CHRATR_CJK_POSTURE, cppu::UnoType<css::awt::FontSlant>::get(), PropertyAttribute::MAYBEVOID, MID_POSTURE }, + { OUString(UNO_NAME_CHAR_FONT_NAME_ASIAN), RES_CHRATR_CJK_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY_NAME }, + { OUString(UNO_NAME_CHAR_FONT_STYLE_NAME_ASIAN), RES_CHRATR_CJK_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_STYLE_NAME }, + { OUString(UNO_NAME_CHAR_FONT_FAMILY_ASIAN), RES_CHRATR_CJK_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY }, + { OUString(UNO_NAME_CHAR_FONT_CHAR_SET_ASIAN), RES_CHRATR_CJK_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_CHAR_SET }, + { OUString(UNO_NAME_CHAR_FONT_PITCH_ASIAN), RES_CHRATR_CJK_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_PITCH }, + // ctl font + { OUString(UNO_NAME_CHAR_HEIGHT_COMPLEX), RES_CHRATR_CTL_FONTSIZE, cppu::UnoType<float>::get(), PropertyAttribute::MAYBEVOID, MID_FONTHEIGHT|CONVERT_TWIPS }, + { OUString(UNO_NAME_CHAR_WEIGHT_COMPLEX), RES_CHRATR_CTL_WEIGHT, cppu::UnoType<float>::get(), PropertyAttribute::MAYBEVOID, MID_WEIGHT }, + { OUString(UNO_NAME_CHAR_POSTURE_COMPLEX), RES_CHRATR_CTL_POSTURE, cppu::UnoType<css::awt::FontSlant>::get(), PropertyAttribute::MAYBEVOID, MID_POSTURE }, + { OUString(UNO_NAME_CHAR_FONT_NAME_COMPLEX), RES_CHRATR_CTL_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY_NAME }, + { OUString(UNO_NAME_CHAR_FONT_STYLE_NAME_COMPLEX), RES_CHRATR_CTL_FONT, cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_STYLE_NAME }, + { OUString(UNO_NAME_CHAR_FONT_FAMILY_COMPLEX), RES_CHRATR_CTL_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_FAMILY }, + { OUString(UNO_NAME_CHAR_FONT_CHAR_SET_COMPLEX), RES_CHRATR_CTL_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_CHAR_SET }, + { OUString(UNO_NAME_CHAR_FONT_PITCH_COMPLEX), RES_CHRATR_CTL_FONT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_FONT_PITCH }, { OUString(), 0, css::uno::Type(), 0, 0 } }; m_aMapEntriesArr[nPropertyId] = aCellStyleMap; diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 30449edfc0a7..98070d5b1e2b 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -4967,6 +4967,135 @@ void SAL_CALL SwXTextCellStyle::setPropertyValue(const OUString& rPropertyName, } return; } + // Paragraph attributes + case RES_PARATR_ADJUST: + { + SvxAdjustItem rAdjustItem = m_pBoxAutoFormat->GetAdjust(); + rAdjustItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetAdjust(rAdjustItem); + return; + } + case RES_CHRATR_COLOR: + { + SvxColorItem rColorItem = m_pBoxAutoFormat->GetColor(); + rColorItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetColor(rColorItem); + return; + } + case RES_CHRATR_SHADOWED: + { + SvxShadowedItem rShadowedItem = m_pBoxAutoFormat->GetShadowed(); + bool bValue; aValue >>= bValue; + rShadowedItem.SetValue(bValue); + m_pBoxAutoFormat->SetShadowed(rShadowedItem); + return; + } + case RES_CHRATR_CONTOUR: + { + SvxContourItem rContourItem = m_pBoxAutoFormat->GetContour(); + bool bValue; aValue >>= bValue; + rContourItem.SetValue(bValue); + m_pBoxAutoFormat->SetContour(rContourItem); + return; + } + case RES_CHRATR_CROSSEDOUT: + { + SvxCrossedOutItem rCrossedOutItem = m_pBoxAutoFormat->GetCrossedOut(); + rCrossedOutItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCrossedOut(rCrossedOutItem); + return; + } + case RES_CHRATR_UNDERLINE: + { + SvxUnderlineItem rUnderlineItem = m_pBoxAutoFormat->GetUnderline(); + rUnderlineItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetUnderline(rUnderlineItem); + return; + } + case RES_CHRATR_FONTSIZE: + { + SvxFontHeightItem rFontHeightItem = m_pBoxAutoFormat->GetHeight(); + rFontHeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetHeight(rFontHeightItem); + return; + } + case RES_CHRATR_WEIGHT: + { + SvxWeightItem rWeightItem = m_pBoxAutoFormat->GetWeight(); + rWeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetWeight(rWeightItem); + return; + } + case RES_CHRATR_POSTURE: + { + SvxPostureItem rPostureItem = m_pBoxAutoFormat->GetPosture(); + rPostureItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetPosture(rPostureItem); + return; + } + case RES_CHRATR_FONT: + { + SvxFontItem rFontItem = m_pBoxAutoFormat->GetFont(); + rFontItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetFont(rFontItem); + return; + } + case RES_CHRATR_CJK_FONTSIZE: + { + SvxFontHeightItem rFontHeightItem = m_pBoxAutoFormat->GetCJKHeight(); + rFontHeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCJKHeight(rFontHeightItem); + return; + } + case RES_CHRATR_CJK_WEIGHT: + { + SvxWeightItem rWeightItem = m_pBoxAutoFormat->GetCJKWeight(); + rWeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCJKWeight(rWeightItem); + return; + } + case RES_CHRATR_CJK_POSTURE: + { + SvxPostureItem rPostureItem = m_pBoxAutoFormat->GetCJKPosture(); + rPostureItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCJKPosture(rPostureItem); + return; + } + case RES_CHRATR_CJK_FONT: + { + SvxFontItem rFontItem = m_pBoxAutoFormat->GetCJKFont(); + rFontItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCJKFont(rFontItem); + return; + } + case RES_CHRATR_CTL_FONTSIZE: + { + SvxFontHeightItem rFontHeightItem = m_pBoxAutoFormat->GetCTLHeight(); + rFontHeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCTLHeight(rFontHeightItem); + return; + } + case RES_CHRATR_CTL_WEIGHT: + { + SvxWeightItem rWeightItem = m_pBoxAutoFormat->GetCTLWeight(); + rWeightItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCTLWeight(rWeightItem); + return; + } + case RES_CHRATR_CTL_POSTURE: + { + SvxPostureItem rPostureItem = m_pBoxAutoFormat->GetCTLPosture(); + rPostureItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCTLPosture(rPostureItem); + return; + } + case RES_CHRATR_CTL_FONT: + { + SvxFontItem rFontItem = m_pBoxAutoFormat->GetCTLFont(); + rFontItem.PutValue(aValue, pEntry->nMemberId); + m_pBoxAutoFormat->SetCTLFont(rFontItem); + return; + } default: SAL_WARN("sw.uno", "SwXTextCellStyle unknown nWID"); throw css::uno::RuntimeException(); @@ -5022,6 +5151,115 @@ css::uno::Any SAL_CALL SwXTextCellStyle::getPropertyValue(const OUString& rPrope } return aRet; } + // Paragraph attributes + case RES_PARATR_ADJUST: + { + const SvxAdjustItem& rAdjustItem = m_pBoxAutoFormat->GetAdjust(); + rAdjustItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_COLOR: + { + const SvxColorItem& rColorItem = m_pBoxAutoFormat->GetColor(); + rColorItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_SHADOWED: + { + const SvxShadowedItem& rShadowedItem = m_pBoxAutoFormat->GetShadowed(); + aRet <<= rShadowedItem.GetValue(); + return aRet; + } + case RES_CHRATR_CONTOUR: + { + const SvxContourItem& rContourItem = m_pBoxAutoFormat->GetContour(); + aRet <<= rContourItem.GetValue(); + return aRet; + } + case RES_CHRATR_CROSSEDOUT: + { + const SvxCrossedOutItem& rCrossedOutItem = m_pBoxAutoFormat->GetCrossedOut(); + rCrossedOutItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_UNDERLINE: + { + const SvxUnderlineItem& rUnderlineItem = m_pBoxAutoFormat->GetUnderline(); + rUnderlineItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_FONTSIZE: + { + const SvxFontHeightItem& rFontHeightItem = m_pBoxAutoFormat->GetHeight(); + rFontHeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_WEIGHT: + { + const SvxWeightItem& rWeightItem = m_pBoxAutoFormat->GetWeight(); + rWeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_POSTURE: + { + const SvxPostureItem& rPostureItem = m_pBoxAutoFormat->GetPosture(); + rPostureItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_FONT: + { + const SvxFontItem rFontItem = m_pBoxAutoFormat->GetFont(); + rFontItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CJK_FONTSIZE: + { + const SvxFontHeightItem rFontHeightItem = m_pBoxAutoFormat->GetCJKHeight(); + rFontHeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CJK_WEIGHT: + { + const SvxWeightItem& rWeightItem = m_pBoxAutoFormat->GetCJKWeight(); + rWeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CJK_POSTURE: + { + const SvxPostureItem& rPostureItem = m_pBoxAutoFormat->GetCJKPosture(); + rPostureItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CJK_FONT: + { + const SvxFontItem rFontItem = m_pBoxAutoFormat->GetCJKFont(); + rFontItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CTL_FONTSIZE: + { + const SvxFontHeightItem rFontHeightItem = m_pBoxAutoFormat->GetCTLHeight(); + rFontHeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CTL_WEIGHT: + { + const SvxWeightItem& rWeightItem = m_pBoxAutoFormat->GetCTLWeight(); + rWeightItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CTL_POSTURE: + { + const SvxPostureItem& rPostureItem = m_pBoxAutoFormat->GetCTLPosture(); + rPostureItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } + case RES_CHRATR_CTL_FONT: + { + const SvxFontItem rFontItem = m_pBoxAutoFormat->GetCTLFont(); + rFontItem.QueryValue(aRet, pEntry->nMemberId); + return aRet; + } default: SAL_WARN("sw.uno", "SwXTextCellStyle unknown nWID"); throw css::uno::RuntimeException(); |