[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng
editeng/source/items/borderline.cxx | 40 ++-- editeng/source/items/frmitems.cxx | 333 +--- include/editeng/borderline.hxx |6 include/editeng/boxitem.hxx | 116 +++- 4 files changed, 254 insertions(+), 241 deletions(-) New commits: commit 358668852337fac9535a12c0150ee8ffc83c666b Author: Tomaž Vajngerl AuthorDate: Fri May 12 16:05:36 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Jun 6 02:20:38 2023 +0200 prefix members and cleanup SvxBoxItem, SvxBoxInfoItem Change-Id: I9f3d36257175a5118a2b8ddca981815b24b8d243 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151718 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit ef106661fcc40cfdd406064cbf73fd62477d0e79) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152624 Tested-by: Jenkins CollaboraOffice diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 890d74a75510..82e81f59d9e4 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1283,29 +1283,23 @@ void SvxShadowItem::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxBoxItem -- -SvxBoxItem::SvxBoxItem( const SvxBoxItem& rCpy ) : - -SfxPoolItem ( rCpy ), -pTop( rCpy.pTop ? new SvxBorderLine( *rCpy.pTop ): nullptr ), -pBottom ( rCpy.pBottom ? new SvxBorderLine( *rCpy.pBottom ) : nullptr ), -pLeft ( rCpy.pLeft? new SvxBorderLine( *rCpy.pLeft ) : nullptr ), -pRight ( rCpy.pRight ? new SvxBorderLine( *rCpy.pRight ) : nullptr ), -nTopDist( rCpy.nTopDist ), -nBottomDist ( rCpy.nBottomDist ), -nLeftDist ( rCpy.nLeftDist ), -nRightDist ( rCpy.nRightDist ), -bRemoveAdjCellBorder ( rCpy.bRemoveAdjCellBorder ) +SvxBoxItem::SvxBoxItem(const SvxBoxItem& rCopy) +: SfxPoolItem (rCopy) +, mpTopBorderLine(rCopy.mpTopBorderLine ? new SvxBorderLine(*rCopy.mpTopBorderLine) : nullptr) +, mpBottomBorderLine(rCopy.mpBottomBorderLine ? new SvxBorderLine(*rCopy.mpBottomBorderLine) : nullptr) +, mpLeftBorderLine(rCopy.mpLeftBorderLine ? new SvxBorderLine(*rCopy.mpLeftBorderLine) : nullptr) +, mpRightBorderLine(rCopy.mpRightBorderLine ? new SvxBorderLine(*rCopy.mpRightBorderLine) : nullptr) +, mnTopDistance(rCopy.mnTopDistance) +, mnBottomDistance(rCopy.mnBottomDistance) +, mnLeftDistance(rCopy.mnLeftDistance) +, mnRightDistance(rCopy.mnRightDistance) +, mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder) { } -SvxBoxItem::SvxBoxItem( const sal_uInt16 nId ) : -SfxPoolItem( nId ), -nTopDist( 0 ), -nBottomDist ( 0 ), -nLeftDist ( 0 ), -nRightDist ( 0 ), -bRemoveAdjCellBorder ( false ) +SvxBoxItem::SvxBoxItem(const sal_uInt16 nId) +: SfxPoolItem(nId) { } @@ -1318,13 +1312,13 @@ void SvxBoxItem::dumpAsXml(xmlTextWriterPtr pWriter) const { (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBoxItem")); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("top-dist"), - BAD_CAST(OString::number(nTopDist).getStr())); + BAD_CAST(OString::number(mnTopDistance).getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bottom-dist"), - BAD_CAST(OString::number(nBottomDist).getStr())); + BAD_CAST(OString::number(mnBottomDistance).getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("left-dist"), - BAD_CAST(OString::number(nLeftDist).getStr())); + BAD_CAST(OString::number(mnLeftDistance).getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("right-dist"), - BAD_CAST(OString::number(nRightDist).getStr())); + BAD_CAST(OString::number(mnRightDistance).getStr())); SfxPoolItem::dumpAsXml(pWriter); (void)xmlTextWriterEndElement(pWriter); } @@ -1346,7 +1340,7 @@ boost::property_tree::ptree SvxBoxItem::dumpAsJSON() const } -static bool CmpBrdLn( const std::unique_ptr & pBrd1, const SvxBorderLine* pBrd2 ) +static bool CompareBorderLine(const std::unique_ptr & pBrd1, const SvxBorderLine* pBrd2) { if( pBrd1.get() == pBrd2 ) return true; @@ -1362,15 +1356,15 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) const const SvxBoxItem& rBoxItem = static_cast(rAttr); return ( -( nTopDist == rBoxItem.nTopDist ) && -( nBottomDist == rBoxItem.nBottomDist ) && -( nLeftDist == rBoxItem.nLeftDist ) && -( nRightDist == rBoxItem.nRightDist ) && -( bRemoveAdjCellBorder == rBoxItem.bRemoveAdjCellBorder ) && -CmpBrdLn( pTop, rBoxItem.GetTop() ) && -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng oox/inc oox/source sd/qa
editeng/source/editeng/editdoc.cxx | 11 + editeng/source/items/paraitem.cxx | 32 include/editeng/memberids.h |1 include/editeng/tstpitem.hxx|3 + include/editeng/unoprnms.hxx|1 include/editeng/unotext.hxx |1 oox/inc/drawingml/textparagraphproperties.hxx |2 + oox/source/drawingml/textparagraphproperties.cxx|7 +++ oox/source/drawingml/textparagraphpropertiescontext.cxx | 12 -- oox/source/token/properties.txt |1 sd/qa/unit/import-tests2.cxx|4 +- 11 files changed, 69 insertions(+), 6 deletions(-) New commits: commit e4952bbf58edeb6f385d4003f370955994426a9f Author: Sarper Akdemir AuthorDate: Tue Feb 28 16:36:40 2023 +0300 Commit: Sarper Akdemir CommitDate: Tue Mar 28 14:53:32 2023 + tdf#102261: pptx import: handle defTabSz Introduce import of defTabSz using ParaTabStopDefaultDistance. Change-Id: Ied59c2bc5d9dfffa6254ef87849c3dbad4c48d07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148059 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149511 Tested-by: Jenkins CollaboraOffice Reviewed-by: Sarper Akdemir diff --git a/oox/inc/drawingml/textparagraphproperties.hxx b/oox/inc/drawingml/textparagraphproperties.hxx index 083b61e37da7..d3742e7377e0 100644 --- a/oox/inc/drawingml/textparagraphproperties.hxx +++ b/oox/inc/drawingml/textparagraphproperties.hxx @@ -89,6 +89,7 @@ public: TextSpacing&getParaBottomMargin() { return maParaBottomMargin; } std::optional< sal_Int32 >& getParaLeftMargin(){ return moParaLeftMargin; } std::optional< sal_Int32 >& getFirstLineIndentation(){ return moFirstLineIndentation; } +std::optional& getDefaultTabSize() { return moDefaultTabSize; } std::optional< css::style::ParagraphAdjust >& getParaAdjust() { return moParaAdjust; } voidsetParaAdjust( css::style::ParagraphAdjust nParaAdjust ) { moParaAdjust = nParaAdjust; } @@ -125,6 +126,7 @@ private: std::optional< sal_Int32 >moParaLeftMargin; std::optional< sal_Int32 >moFirstLineIndentation; std::optional< css::style::ParagraphAdjust >moParaAdjust; +std::optional< sal_Int32 > moDefaultTabSize; sal_Int16 mnLevel; TextSpacing maLineSpacing; }; diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 0006b7530a76..af65e0037d16 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -395,6 +395,8 @@ void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps moParaLeftMargin = rSourceProps.moParaLeftMargin; if ( rSourceProps.moFirstLineIndentation ) moFirstLineIndentation = rSourceProps.moFirstLineIndentation; +if ( rSourceProps.moDefaultTabSize ) +moDefaultTabSize = rSourceProps.moDefaultTabSize; if( rSourceProps.mnLevel ) mnLevel = rSourceProps.mnLevel; if( rSourceProps.moParaAdjust ) @@ -501,6 +503,11 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p } } +if ( moDefaultTabSize ) +{ +aPropSet.setProperty( PROP_ParaTabStopDefaultDistance, *moDefaultTabSize ); +} + if ( moParaAdjust ) { aPropSet.setProperty( PROP_ParaAdjust, *moParaAdjust); diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 4e83d2ece24b..e75d65913cd9 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -93,10 +93,14 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H // TODO see to do the same with RubyAdjust // ST_Coordinate32 -// sValue = rAttribs.getString( XML_defTabSz ).get();SJ: we need to be able to set the default tab size for each text object, -// this is possible at the moment only for the whole document. -// sal_Int32 nDefTabSize = ( sValue.getLength() == 0 ? 0 : GetCoordinate( sValue ) ); -// TODO +if ( rAttribs.hasAttribute(XML_defTabSz)) +{ +sValue = rAttribs.getStringDefaulted(XML_defTabSz); +if(!sValue.isEmpty()) +{ +mrTextParagraphProperties.getDefaultTabSize() = GetCoordinate(sValue); +} +} // bool bEaLineBrk = rAttribs.getBool( XML_eaLnBrk, true ); if ( rAttribs.hasAttribute( XML_latinLnBrk ) ) diff --git a/oo
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng sw/CppunitTest_sw_core_theme.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source xmlo
editeng/source/items/textitem.cxx | 25 +++ include/editeng/colritem.hxx | 26 --- include/editeng/unoprnms.hxx |2 sw/CppunitTest_sw_core_theme.mk | 62 ++ sw/Module_sw.mk |1 sw/qa/core/theme/ThemeTest.cxx| 35 ++ sw/qa/core/theme/data/ThemeColorInHeading.docx|binary sw/source/core/unocore/unomap.cxx |4 - sw/source/core/unocore/unomap1.cxx|6 + sw/source/core/unocore/unomapproperties.hxx |6 + sw/source/uibase/sidebar/ThemePanel.cxx | 29 ++-- sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 14 ++-- writerfilter/source/dmapper/DomainMapper.cxx | 16 writerfilter/source/dmapper/PropertyIds.cxx |2 writerfilter/source/dmapper/PropertyIds.hxx |2 writerfilter/source/dmapper/TDefTableHandler.cxx | 44 writerfilter/source/dmapper/TDefTableHandler.hxx |1 xmloff/inc/XMLThemeColorHandler.hxx | 49 ++ xmloff/inc/enummaps.hxx |2 xmloff/source/draw/sdpropls.cxx |3 xmloff/source/text/txtprhdl.cxx |6 + 21 files changed, 281 insertions(+), 54 deletions(-) New commits: commit f627192b6055479a2ac2fecd6a8349c0fdc131fc Author: Tomaž Vajngerl AuthorDate: Mon Dec 5 13:59:22 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Jan 20 07:11:05 2023 + editeng: move "tint or shade" variable into SvxThemeColor Change-Id: Ia2094854a8275082cf7444307e17fe5449c43b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143698 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 6fb682487e355933d79a8ef74560ecf318b4f705) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145834 Tested-by: Tomaž Vajngerl diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 147fa301d548..30b780f1b855 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1354,9 +1354,10 @@ bool SvxContourItem::GetPresentation } SvxThemeColor::SvxThemeColor() -: maThemeIndex(-1), -mnLumMod(1), -mnLumOff(0) +: maThemeIndex(-1) +, mnLumMod(1) +, mnLumOff(0) +, mnTintOrShade(0) { } @@ -1364,7 +1365,8 @@ bool SvxThemeColor::operator==(const SvxThemeColor& rThemeColor) const { return maThemeIndex == rThemeColor.maThemeIndex && mnLumMod == rThemeColor.mnLumMod && -mnLumOff == rThemeColor.mnLumOff; +mnLumOff == rThemeColor.mnLumOff && +mnTintOrShade == rThemeColor.mnTintOrShade; } void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const @@ -1377,6 +1379,8 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const BAD_CAST(OString::number(mnLumMod).getStr())); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("lum-off"), BAD_CAST(OString::number(mnLumOff).getStr())); +(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("tint-or-shade"), + BAD_CAST(OString::number(mnTintOrShade).getStr())); (void)xmlTextWriterEndElement(pWriter); } @@ -1384,15 +1388,13 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxColorItem SvxColorItem::SvxColorItem( const sal_uInt16 nId ) : SfxPoolItem(nId), -mColor( COL_BLACK ), -maTintShade(0) +mColor( COL_BLACK ) { } SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) : SfxPoolItem( nId ), -mColor( rCol ), -maTintShade(0) +mColor( rCol ) { } @@ -1406,8 +1408,7 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const const SvxColorItem& rColorItem = static_cast(rAttr); return mColor == rColorItem.mColor && - maThemeColor == rColorItem.maThemeColor && - maTintShade == rColorItem.maTintShade; + maThemeColor == rColorItem.maThemeColor; } bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1433,7 +1434,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const } case MID_COLOR_TINT_OR_SHADE: { -rVal <<= maTintShade; +rVal <<= maThemeColor.GetTintOrShade(); break; } case MID_COLOR_LUM_MOD: @@ -1489,7 +1490,7 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nTintShade = -1; if (!(rVal >>= nTintShade)) return false; -maTintShade = nTintShade; +maThemeColor.S