22#include <com/sun/star/text/XNumberingRulesSupplier.hpp>
23#include <com/sun/star/container/XIndexReplace.hpp>
24#include <com/sun/star/text/HoriOrientation.hpp>
25#include <com/sun/star/awt/FontDescriptor.hpp>
26#include <com/sun/star/awt/FontWeight.hpp>
27#include <com/sun/star/awt/XBitmap.hpp>
28#include <com/sun/star/graphic/XGraphic.hpp>
29#include <com/sun/star/beans/PropertyValue.hpp>
30#include <com/sun/star/style/NumberingType.hpp>
31#include <com/sun/star/style/TabStop.hpp>
32#include <com/sun/star/style/ParagraphAdjust.hpp>
33#include <com/sun/star/drawing/XDrawPage.hpp>
35#include <osl/diagnose.h>
39#include <oox/token/properties.hxx>
40#include <oox/token/tokens.hxx>
42#if OSL_DEBUG_LEVEL > 0
43#include <com/sun/star/lang/XMultiServiceFactory.hpp>
44#include <com/sun/star/text/XText.hpp>
45#include <com/sun/star/drawing/XShape.hpp>
56using ::com::sun::star::awt::FontDescriptor;
62 mbBulletColorFollowText ( false ),
63 mbBulletFontFollowText ( false ),
64 mbBulletSizeFollowText ( false )
122 OSL_ASSERT((
nType & sal_Int32(0xFFFF0000))==0);
125 case XML_alphaLcParenBoth:
129 case XML_alphaLcParenR:
133 case XML_alphaLcPeriod:
137 case XML_alphaUcParenBoth:
141 case XML_alphaUcParenR:
145 case XML_alphaUcPeriod:
149 case XML_arabic1Minus:
150 case XML_arabic2Minus:
151 case XML_arabicDbPeriod:
152 case XML_arabicDbPlain:
155 case XML_arabicParenBoth:
159 case XML_arabicParenR:
163 case XML_arabicPeriod:
167 case XML_arabicPlain:
171 case XML_circleNumDbPlain:
172 case XML_circleNumWdBlackPlain:
173 case XML_circleNumWdWhitePlain:
176 case XML_ea1ChsPeriod:
180 case XML_ea1ChsPlain:
184 case XML_ea1ChtPeriod:
188 case XML_ea1ChtPlain:
192 case XML_ea1JpnChsDbPeriod:
193 case XML_ea1JpnKorPeriod:
194 case XML_ea1JpnKorPlain:
196 case XML_hebrew2Minus:
200 case XML_hindiAlpha1Period:
201 case XML_hindiAlphaPeriod:
202 case XML_hindiNumParenR:
203 case XML_hindiNumPeriod:
206 case XML_romanLcParenBoth:
210 case XML_romanLcParenR:
214 case XML_romanLcPeriod:
218 case XML_romanUcParenBoth:
222 case XML_romanUcParenR:
226 case XML_romanUcPeriod:
230 case XML_thaiAlphaParenBoth:
231 case XML_thaiNumParenBoth:
235 case XML_thaiAlphaParenR:
236 case XML_thaiNumParenR:
240 case XML_thaiAlphaPeriod:
241 case XML_thaiNumPeriod:
284 if ( rSource.
mnSize.hasValue() )
304 rPropMap.
setProperty( PROP_Adjust, HoriOrientation::LEFT);
309 OUString aBulletFontName;
310 sal_Int16 nBulletFontPitch = 0;
311 sal_Int16 nBulletFontFamily = 0;
312 float nBulletFontWeight = css::awt::FontWeight::NORMAL;
313 bool bSymbolFont =
false;
315 bool bFollowTextFont =
false;
317 if (!bFollowTextFont &&
maBulletFont.
getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) )
319 FontDescriptor aFontDesc;
320 sal_Int16 nFontSize = 0;
322 aFontDesc.Height = nFontSize;
325 aFontDesc.Name = aBulletFontName;
326 aFontDesc.Pitch = nBulletFontPitch;
327 aFontDesc.Family = nBulletFontFamily;
328 aFontDesc.Weight = nBulletFontWeight;
329 if ( aBulletFontName.equalsIgnoreAsciiCase(
"Wingdings") ||
330 aBulletFontName.equalsIgnoreAsciiCase(
"Wingdings 2") ||
331 aBulletFontName.equalsIgnoreAsciiCase(
"Wingdings 3") ||
332 aBulletFontName.equalsIgnoreAsciiCase(
"Monotype Sorts") ||
333 aBulletFontName.equalsIgnoreAsciiCase(
"Monotype Sorts 2") ||
334 aBulletFontName.equalsIgnoreAsciiCase(
"Webdings") ||
335 aBulletFontName.equalsIgnoreAsciiCase(
"StarBats") ||
336 aBulletFontName.equalsIgnoreAsciiCase(
"StarMath") ||
337 aBulletFontName.equalsIgnoreAsciiCase(
"ZapfDingbats") ) {
338 aFontDesc.CharSet = RTL_TEXTENCODING_SYMBOL;
342 rPropMap.
setProperty( PROP_BulletFontName, aBulletFontName);
350 if( pFilterBase && sBuChar.getLength() == 1 &&
maBulletFont.
getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) && bSymbolFont )
355 sBuChar = OUString( &nBuChar, 1 );
366 bool bFollowTextSize =
false;
368 if( !bFollowTextSize &&
mnSize.hasValue() )
373 bool bFollowTextColor =
false;
410 bool bPushDefaultValues )
const
415 sal_Int32 nNumberingType = NumberingType::NUMBER_NONE;
423 if ( nNumberingType == NumberingType::NUMBER_NONE )
424 aPropSet.
setProperty< sal_Int16 >( PROP_NumberingLevel, -1 );
436 if ( nNumberingType != NumberingType::NUMBER_NONE )
438 if ( noParaLeftMargin )
442 noParaLeftMargin.reset();
444 if ( noFirstLineIndentation )
449 rioBulletMap.
setProperty( PROP_FirstLineOffset, *noFirstLineIndentation);
450 noFirstLineIndentation.reset();
452 if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.
hasProperty( PROP_BulletColor ) && pFilterBase )
456 if ( bApplyBulletMap )
460 OSL_ENSURE( xNumRule.is(),
"can't get Numbering rules");
466 if( !rioBulletMap.
empty() )
469 if( !rioBulletMap.
hasProperty( PROP_BulletRelSize ) )
470 rioBulletMap.
setProperty<sal_Int16>( PROP_BulletRelSize, 100);
472 xNumRule->replaceByIndex(
getLevel(),
Any( aBulletPropSeq ) );
483 if ( noParaLeftMargin )
485 if ( noFirstLineIndentation )
488 if( bPushDefaultValues )
492 aTabStop.Position = 0;
537 xDebugPage->add( xShape );
541 xText->setString(
"debug" );
543 xStart->gotoEnd(
true );
545 pushToPropSet(
nullptr, xPropSet, emptyMap,
nullptr,
false, 0 );
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
A helper that maps property identifiers to property values.
bool setAnyProperty(sal_Int32 nPropId, const css::uno::Any &rValue)
Sets the specified property to the passed value.
bool hasProperty(sal_Int32 nPropId) const
Returns true, if the map contains a property with the passed identifier.
void assignAll(const PropertyMap &rPropMap)
Inserts all properties contained in the passed property map.
css::uno::Sequence< css::beans::PropertyValue > makePropertyValueSequence() const
Returns a sequence of property values, filled with all contained properties.
bool setProperty(sal_Int32 nPropId, Type &&rValue)
Sets the specified property to the passed value.
A wrapper for a UNO property set.
void setProperties(const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues)
Puts the passed properties into the property set.
bool getProperty(Type &orValue, sal_Int32 nPropId) const
Gets the specified property from the property set.
bool setProperty(sal_Int32 nPropId, const Type &rValue)
Puts the passed value into the property set.
css::uno::Any mnAspectRatio
css::uno::Any mbBulletFontFollowText
css::uno::Any msBulletChar
css::uno::Any mnNumberingType
void setBulletAspectRatio(double nAspectRatio)
void setBulletSize(sal_Int16 nSize)
void pushToPropMap(const ::oox::core::XmlFilterBase *pFilterBase, PropertyMap &xPropMap) const
css::uno::Any msNumberingSuffix
void apply(const BulletList &)
void setBulletChar(const OUString &sChar)
void setType(sal_Int32 nType)
css::uno::Any mbBulletSizeFollowText
void setFontSize(sal_Int16 nSize)
void setGraphic(css::uno::Reference< css::graphic::XGraphic > const &rXGraphic)
void setSuffixParenRight()
void setSuffixMinusRight()
css::uno::Any msNumberingPrefix
::oox::drawingml::TextFont maBulletFont
void setSuffixParenBoth()
std::shared_ptr< ::oox::drawingml::Color > maBulletColorPtr
css::uno::Any mbBulletColorFollowText
css::uno::Any maStyleName
::Color getColor(const GraphicHelper &rGraphicHelper, ::Color nPhClr=API_RGB_TRANSPARENT) const
Returns the final RGB color value.
void assignIfUsed(const TextFont &rTextFont)
Overwrites this text font with the passed text font, if it is used.
bool getFontData(OUString &rFontName, sal_Int16 &rnFontPitch, sal_Int16 &rnFontFamily, const ::oox::core::XmlFilterBase &rFilter) const
Returns the font name, pitch, and family; tries to resolve theme placeholder names,...
PropertyMap maTextParagraphPropertyMap
TextSpacing maLineSpacing
TextParagraphProperties()
TextSpacing maParaBottomMargin
TextSpacing maParaTopMargin
std::optional< sal_Int32 > moDefaultTabSize
TextCharacterProperties maTextCharacterProperties
float getCharHeightPoints(float fDefault) const
Returns the largest character size of this paragraph.
std::optional< css::style::ParagraphAdjust > moParaAdjust
std::optional< sal_Int32 > moFirstLineIndentation
void apply(const TextParagraphProperties &rSourceProps)
std::optional< sal_Int32 > moParaLeftMargin
sal_Int16 getLevel() const
void pushToPropSet(const ::oox::core::XmlFilterBase *pFilterBase, const css::uno::Reference< css::beans::XPropertySet > &xPropSet, PropertyMap &rioBulletList, const BulletList *pMasterBuList, bool bApplyBulletList, float fFontSize, bool bPushDefaultValues=false) const
css::style::LineSpacing toLineSpacing() const
sal_Int32 toMargin(float fFontSize) const
static XmlFilterBase * mpDebugFilterBase
static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage
Sequence< sal_Int8 > aSeq
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
std::shared_ptr< T > make_shared(Args &&... args)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Color getBestSolidColor() const
Tries to resolve current settings to a solid color, e.g.
float getCharHeightPoints(float fDefault) const
Returns the current character size.
void assignUsed(const TextCharacterProperties &rSourceProps)
Overwrites all members that are explicitly set in rSourceProps.
FillProperties maFillProperties
constexpr OUStringLiteral PROP_CharStyleName
constexpr OUStringLiteral PROP_ParaLeftMargin
constexpr OUStringLiteral PROP_ParaTopMargin
constexpr OUStringLiteral PROP_ParaFirstLineIndent
constexpr OUStringLiteral PROP_ParaTabStops
constexpr OUStringLiteral PROP_ParaTabStopDefaultDistance
constexpr OUStringLiteral PROP_ParaLineSpacing
constexpr OUStringLiteral PROP_NumberingRules
constexpr OUStringLiteral PROP_LeftMargin
constexpr OUStringLiteral PROP_ParaAdjust
constexpr OUStringLiteral PROP_NumberingType
constexpr OUStringLiteral PROP_ParaBottomMargin