Kaydet (Commit) ba951a96 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:singlevalfields in lotuswordpro

Change-Id: Iac507cb050c93367a8d5dd4cc33106f54c5d462f
Reviewed-on: https://gerrit.libreoffice.org/61816
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8b0631fe
...@@ -116,7 +116,6 @@ private: ...@@ -116,7 +116,6 @@ private:
friend class XFBorders; friend class XFBorders;
private: private:
double m_fOffset;
XFColor m_aColor; XFColor m_aColor;
bool m_bDouble; bool m_bDouble;
bool m_bSameWidth; bool m_bSameWidth;
......
...@@ -137,7 +137,6 @@ private: ...@@ -137,7 +137,6 @@ private:
enumXFAlignType m_eHoriAlign; enumXFAlignType m_eHoriAlign;
enumXFAlignType m_eVertAlign; enumXFAlignType m_eVertAlign;
double m_fTextIndent;
XFColor m_aBackColor; XFColor m_aBackColor;
std::unique_ptr<XFBGImage> m_xBackImage; std::unique_ptr<XFBGImage> m_xBackImage;
XFMargins m_aMargin; XFMargins m_aMargin;
...@@ -145,7 +144,6 @@ private: ...@@ -145,7 +144,6 @@ private:
rtl::Reference<XFFont> m_pFont; rtl::Reference<XFFont> m_pFont;
XFShadow m_aShadow; XFShadow m_aShadow;
std::unique_ptr<XFBorders> m_pBorders; std::unique_ptr<XFBorders> m_pBorders;
bool m_bWrapText;
}; };
inline void XFCellStyle::SetAlignType(enumXFAlignType hori, enumXFAlignType vert) inline void XFCellStyle::SetAlignType(enumXFAlignType hori, enumXFAlignType vert)
......
...@@ -122,7 +122,6 @@ public: ...@@ -122,7 +122,6 @@ public:
private: private:
std::unique_ptr<XFFontWorkStyle> m_pFontWorkStyle; std::unique_ptr<XFFontWorkStyle> m_pFontWorkStyle;
enumXFWrap m_eWrap;
XFDrawLineStyle *m_pLineStyle; XFDrawLineStyle *m_pLineStyle;
XFDrawAreaStyle *m_pAreaStyle; XFDrawAreaStyle *m_pAreaStyle;
OUString m_strArrowStart; OUString m_strArrowStart;
......
...@@ -242,18 +242,10 @@ private: ...@@ -242,18 +242,10 @@ private:
enumXFUnderline m_eUnderline; enumXFUnderline m_eUnderline;
enumXFCrossout m_eCrossout; enumXFCrossout m_eCrossout;
enumXFRelief m_eRelief;
enumXFTransform m_eTransform; enumXFTransform m_eTransform;
enumXFEmphasize m_eEmphasize;
bool m_bWordByWord; bool m_bWordByWord;
bool m_bEmphasizeTop;
bool m_bOutline;
bool m_bShadow;
bool m_bBlink;
sal_Int16 m_nPosition; sal_Int16 m_nPosition;
sal_Int16 m_nScale; sal_Int16 m_nScale;
double m_fCharSpace;
sal_Int16 m_nWidthScale;
XFColor m_aColor; XFColor m_aColor;
XFColor m_aBackColor; XFColor m_aBackColor;
//The flag defines which variable will be functional //The flag defines which variable will be functional
......
...@@ -100,11 +100,8 @@ private: ...@@ -100,11 +100,8 @@ private:
enumXFNumberType m_eType; enumXFNumberType m_eType;
sal_Int32 m_nDecimalDigits; sal_Int32 m_nDecimalDigits;
sal_Int32 m_nMinInteger;
sal_Int32 m_nMinExponent;
bool m_bGroup; bool m_bGroup;
XFColor m_aColor; XFColor m_aColor;
bool m_bCurrencySymbolPost;
OUString m_strCurrencySymbol; OUString m_strCurrencySymbol;
OUString m_strPrefix; OUString m_strPrefix;
OUString m_strSuffix; OUString m_strSuffix;
......
...@@ -221,9 +221,6 @@ public: ...@@ -221,9 +221,6 @@ public:
protected: protected:
OUString m_strMasterPage; OUString m_strMasterPage;
enumXFAlignType m_eAlignType; enumXFAlignType m_eAlignType;
enumXFAlignType m_eLastLineAlign;
bool m_bJustSingleWord;
bool m_bKeepWithNext;
double m_fTextIndent; double m_fTextIndent;
XFColor m_aBackColor; XFColor m_aBackColor;
...@@ -237,9 +234,6 @@ protected: ...@@ -237,9 +234,6 @@ protected:
XFDropcap m_aDropcap; XFDropcap m_aDropcap;
XFLineHeight m_aLineHeight; XFLineHeight m_aLineHeight;
XFBreaks m_aBreaks; XFBreaks m_aBreaks;
sal_Int32 m_nPageNumber;
bool m_bNumberLines;
sal_Int32 m_nLineNumberRestart;
sal_uInt32 m_nFlag; sal_uInt32 m_nFlag;
bool m_bNumberRight; bool m_bNumberRight;
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
XFBorder::XFBorder() XFBorder::XFBorder()
{ {
m_fOffset = 0;
m_bDouble = false; m_bDouble = false;
m_bSameWidth = false; m_bSameWidth = false;
m_fWidthInner = 0; m_fWidthInner = 0;
...@@ -154,8 +153,6 @@ OUString XFBorder::ToString() ...@@ -154,8 +153,6 @@ OUString XFBorder::ToString()
bool operator==(XFBorder const & b1, XFBorder const & b2) bool operator==(XFBorder const & b1, XFBorder const & b2)
{ {
if( b1.m_fOffset != b2.m_fOffset )
return false;
if( b1.m_bDouble != b2.m_bDouble ) if( b1.m_bDouble != b2.m_bDouble )
return false; return false;
if( !b1.m_bDouble ) if( !b1.m_bDouble )
......
...@@ -65,8 +65,6 @@ ...@@ -65,8 +65,6 @@
XFCellStyle::XFCellStyle() XFCellStyle::XFCellStyle()
: m_eHoriAlign(enumXFAlignNone) : m_eHoriAlign(enumXFAlignNone)
, m_eVertAlign(enumXFAlignNone) , m_eVertAlign(enumXFAlignNone)
, m_fTextIndent(0)
, m_bWrapText(false)
{} {}
XFCellStyle::~XFCellStyle() XFCellStyle::~XFCellStyle()
...@@ -124,8 +122,6 @@ bool XFCellStyle::Equal(IXFStyle *pStyle) ...@@ -124,8 +122,6 @@ bool XFCellStyle::Equal(IXFStyle *pStyle)
if( m_strParentStyleName != pOther->m_strParentStyleName ) if( m_strParentStyleName != pOther->m_strParentStyleName )
return false; return false;
if( m_fTextIndent != pOther->m_fTextIndent )
return false;
//align: //align:
if( m_eHoriAlign != pOther->m_eHoriAlign ) if( m_eHoriAlign != pOther->m_eHoriAlign )
...@@ -145,10 +141,6 @@ bool XFCellStyle::Equal(IXFStyle *pStyle) ...@@ -145,10 +141,6 @@ bool XFCellStyle::Equal(IXFStyle *pStyle)
if( m_aPadding != pOther->m_aPadding ) if( m_aPadding != pOther->m_aPadding )
return false; return false;
//wrap:
if( m_bWrapText != pOther->m_bWrapText )
return false;
//font: //font:
if( m_pFont.is() ) if( m_pFont.is() )
{ {
...@@ -210,11 +202,6 @@ void XFCellStyle::ToXml(IXFStream *pStrm) ...@@ -210,11 +202,6 @@ void XFCellStyle::ToXml(IXFStream *pStrm)
//Paragraph properties: //Paragraph properties:
pAttrList->Clear(); pAttrList->Clear();
//text indent:
if( m_fTextIndent>FLOAT_MIN )
{
pAttrList->AddAttribute("fo:text-indent", OUString::number(m_fTextIndent) + "cm" );
}
//padding: //padding:
m_aPadding.ToXml(pStrm); m_aPadding.ToXml(pStrm);
//margin: //margin:
...@@ -229,10 +216,6 @@ void XFCellStyle::ToXml(IXFStream *pStrm) ...@@ -229,10 +216,6 @@ void XFCellStyle::ToXml(IXFStream *pStrm)
if( m_eVertAlign != enumXFAlignNone ) if( m_eVertAlign != enumXFAlignNone )
pAttrList->AddAttribute( "fo:vertical-align", GetAlignName(m_eVertAlign) ); pAttrList->AddAttribute( "fo:vertical-align", GetAlignName(m_eVertAlign) );
//wrap text:
if( m_bWrapText )
pAttrList->AddAttribute( "fo:wrap-option", "wrap" );
//shadow: //shadow:
m_aShadow.ToXml(pStrm); m_aShadow.ToXml(pStrm);
//borders: //borders:
......
...@@ -64,8 +64,7 @@ ...@@ -64,8 +64,7 @@
#include "xffontworkstyle.hxx" #include "xffontworkstyle.hxx"
#include <lwpglobalmgr.hxx> #include <lwpglobalmgr.hxx>
XFDrawStyle::XFDrawStyle() XFDrawStyle::XFDrawStyle()
: m_eWrap(enumXFWrapNone) : m_pLineStyle(nullptr)
, m_pLineStyle(nullptr)
, m_pAreaStyle(nullptr) , m_pAreaStyle(nullptr)
, m_fArrowStartSize(0.3) , m_fArrowStartSize(0.3)
, m_fArrowEndSize(0.3) , m_fArrowEndSize(0.3)
...@@ -165,27 +164,8 @@ void XFDrawStyle::ToXml(IXFStream *pStrm) ...@@ -165,27 +164,8 @@ void XFDrawStyle::ToXml(IXFStream *pStrm)
pAttrList->Clear(); pAttrList->Clear();
if( m_eWrap == enumXFWrapBackground ) pAttrList->AddAttribute( "style:run-through", "foreground" );
{ pAttrList->AddAttribute( "style:wrap", "none" );
pAttrList->AddAttribute( "style:run-through", "background" );
}
else
{
pAttrList->AddAttribute( "style:run-through", "foreground" );
if( m_eWrap == enumXFWrapNone )
pAttrList->AddAttribute( "style:wrap", "none" );
else if( m_eWrap == enumXFWrapLeft )
pAttrList->AddAttribute( "style:wrap", "left" );
else if( m_eWrap == enumXFWrapRight )
pAttrList->AddAttribute( "style:wrap", "right" );
else if( m_eWrap == enumXFWrapParallel )
pAttrList->AddAttribute( "style:wrap", "parallel" );
else if( m_eWrap == enumXFWrapRunThrough )
pAttrList->AddAttribute( "style:wrap", "run-through" );
else if( m_eWrap == enumXFWrapBest )
pAttrList->AddAttribute( "style:wrap", "dynamic" );
}
//line style: //line style:
if( m_pLineStyle ) if( m_pLineStyle )
......
...@@ -71,18 +71,10 @@ XFFont::XFFont() ...@@ -71,18 +71,10 @@ XFFont::XFFont()
, m_bBoldComplex(false) , m_bBoldComplex(false)
, m_eUnderline(enumXFUnderlineNone) , m_eUnderline(enumXFUnderlineNone)
, m_eCrossout(enumXFCrossoutNone) , m_eCrossout(enumXFCrossoutNone)
, m_eRelief(enumXFReliefNone)
, m_eTransform(enumXFTransformNone) , m_eTransform(enumXFTransformNone)
, m_eEmphasize(enumXFEmphasizeNone)
, m_bWordByWord(false) , m_bWordByWord(false)
, m_bEmphasizeTop(true)
, m_bOutline(false)
, m_bShadow(false)
, m_bBlink(false)
, m_nPosition(33) , m_nPosition(33)
, m_nScale(58) , m_nScale(58)
, m_fCharSpace(0)
, m_nWidthScale(100)
, m_nFlag(0) , m_nFlag(0)
, m_bTransparent(false) , m_bTransparent(false)
{ {
...@@ -154,47 +146,15 @@ bool operator==(XFFont const & f1, XFFont const & f2) ...@@ -154,47 +146,15 @@ bool operator==(XFFont const & f1, XFFont const & f2)
return false; return false;
} }
if( f1.m_nFlag&XFFONT_FLAG_RELIEF )
{
if( f1.m_eRelief != f2.m_eRelief )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_TRANSFORM ) if( f1.m_nFlag&XFFONT_FLAG_TRANSFORM )
{ {
if( f1.m_eTransform != f2.m_eTransform ) if( f1.m_eTransform != f2.m_eTransform )
return false; return false;
} }
if( f1.m_nFlag&XFFONT_FLAG_EMPHASIZE )
{
if( f1.m_eEmphasize != f2.m_eEmphasize )
return false;
if( f1.m_bEmphasizeTop != f2.m_bEmphasizeTop )
return false;
}
if( f1.m_bWordByWord != f2.m_bWordByWord ) if( f1.m_bWordByWord != f2.m_bWordByWord )
return false; return false;
if( f1.m_nFlag&XFFONT_FLAG_OUTLINE )
{
if( f1.m_bOutline != f2.m_bOutline )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_SHADOW )
{
if( f1.m_bShadow != f2.m_bShadow )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_BLINK )
{
if( f1.m_bBlink != f2.m_bBlink )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_POSITION ) if( f1.m_nFlag&XFFONT_FLAG_POSITION )
{ {
if( f1.m_nPosition != f2.m_nPosition ) if( f1.m_nPosition != f2.m_nPosition )
...@@ -207,18 +167,6 @@ bool operator==(XFFont const & f1, XFFont const & f2) ...@@ -207,18 +167,6 @@ bool operator==(XFFont const & f1, XFFont const & f2)
return false; return false;
} }
if( f1.m_nFlag&XFFONT_FLAG_CHARSPACE )
{
if( f1.m_fCharSpace != f2.m_fCharSpace )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_WIDTHSCALE )
{
if( f1.m_nWidthScale != f2.m_nWidthScale )
return false;
}
if( f1.m_nFlag&XFFONT_FLAG_COLOR ) if( f1.m_nFlag&XFFONT_FLAG_COLOR )
{ {
if( f1.m_aColor != f2.m_aColor ) if( f1.m_aColor != f2.m_aColor )
...@@ -331,11 +279,6 @@ void XFFont::ToXml(IXFStream *pStrm) ...@@ -331,11 +279,6 @@ void XFFont::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute("fo:score-spaces", "true" ); pAttrList->AddAttribute("fo:score-spaces", "true" );
} }
if( (m_nFlag & XFFONT_FLAG_RELIEF) && m_eRelief )
{
pAttrList->AddAttribute("style:font-relief", GetReliefName(m_eRelief) );
}
if( (m_nFlag & XFFONT_FLAG_TRANSFORM) && m_eTransform ) if( (m_nFlag & XFFONT_FLAG_TRANSFORM) && m_eTransform )
{ {
//enumTransformSmallCap is different: //enumTransformSmallCap is different:
...@@ -345,30 +288,6 @@ void XFFont::ToXml(IXFStream *pStrm) ...@@ -345,30 +288,6 @@ void XFFont::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute("fo:text-transform", GetTransformName(m_eTransform) ); pAttrList->AddAttribute("fo:text-transform", GetTransformName(m_eTransform) );
} }
if( (m_nFlag & XFFONT_FLAG_EMPHASIZE) && m_eEmphasize )
{
OUString empha = GetEmphasizeName(m_eEmphasize);
empha += " ";
if( m_bEmphasizeTop )
empha += "above";
pAttrList->AddAttribute("style:text-emphasize", empha );
}
if( (m_nFlag & XFFONT_FLAG_OUTLINE) && m_bOutline )
{
pAttrList->AddAttribute("style:text-outline", "true" );
}
if( (m_nFlag & XFFONT_FLAG_SHADOW) && m_bShadow )
{
pAttrList->AddAttribute("fo:text-shadow", "1pt 1pt" );
}
if( (m_nFlag & XFFONT_FLAG_BLINK) && m_bBlink )
{
pAttrList->AddAttribute("style:text-blinking", "true" );
}
//position & scale: //position & scale:
if( ((m_nFlag & XFFONT_FLAG_SCALE) && m_nScale>0 ) || if( ((m_nFlag & XFFONT_FLAG_SCALE) && m_nScale>0 ) ||
((m_nFlag & XFFONT_FLAG_POSITION) && m_nPosition != 0) ((m_nFlag & XFFONT_FLAG_POSITION) && m_nPosition != 0)
...@@ -380,17 +299,6 @@ void XFFont::ToXml(IXFStream *pStrm) ...@@ -380,17 +299,6 @@ void XFFont::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute("style:text-position", tmp ); pAttrList->AddAttribute("style:text-position", tmp );
} }
//char space:
if( (m_nFlag & XFFONT_FLAG_CHARSPACE) && m_fCharSpace != 0 )
{
pAttrList->AddAttribute("fo:letter-spacing", OUString::number(m_fCharSpace)+"cm" );
}
if( (m_nFlag&XFFONT_FLAG_WIDTHSCALE) && m_nWidthScale != 100 )
{
pAttrList->AddAttribute("style:text-scale", OUString::number(m_nWidthScale)+"%" );
}
//Color: //Color:
if( m_nFlag & XFFONT_FLAG_COLOR ) if( m_nFlag & XFFONT_FLAG_COLOR )
{ {
......
...@@ -62,11 +62,8 @@ ...@@ -62,11 +62,8 @@
XFNumberStyle::XFNumberStyle() XFNumberStyle::XFNumberStyle()
: m_eType(enumXFNumberNumber) : m_eType(enumXFNumberNumber)
, m_nDecimalDigits(0) , m_nDecimalDigits(0)
, m_nMinInteger(1)
, m_nMinExponent(2)
, m_bGroup(false) , m_bGroup(false)
, m_aColor(0,0,0) , m_aColor(0,0,0)
, m_bCurrencySymbolPost(false)
, m_bRedIfNegative(false) , m_bRedIfNegative(false)
, m_aNegativeColor(255,0,0) , m_aNegativeColor(255,0,0)
{} {}
...@@ -88,8 +85,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle) ...@@ -88,8 +85,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle)
return false; return false;
if( m_nDecimalDigits != pOther->m_nDecimalDigits ) if( m_nDecimalDigits != pOther->m_nDecimalDigits )
return false; return false;
if( m_nMinInteger != pOther->m_nMinInteger )
return false;
if( m_bRedIfNegative != pOther->m_bRedIfNegative ) if( m_bRedIfNegative != pOther->m_bRedIfNegative )
return false; return false;
if( m_bGroup != pOther->m_bGroup ) if( m_bGroup != pOther->m_bGroup )
...@@ -101,10 +96,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle) ...@@ -101,10 +96,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle)
if( m_strSuffix != pOther->m_strSuffix ) if( m_strSuffix != pOther->m_strSuffix )
return false; return false;
//When category of number format is scientific, the number can not be displayed normally in table.
if ( m_nMinExponent != pOther->m_nMinExponent )
return false;
if( m_bRedIfNegative ) if( m_bRedIfNegative )
{ {
if( m_aNegativeColor != pOther->m_aNegativeColor ) if( m_aNegativeColor != pOther->m_aNegativeColor )
...@@ -117,8 +108,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle) ...@@ -117,8 +108,6 @@ bool XFNumberStyle::Equal(IXFStyle *pStyle)
if( m_eType == enuMXFNumberCurrency ) if( m_eType == enuMXFNumberCurrency )
{ {
if( m_bCurrencySymbolPost != pOther->m_bCurrencySymbolPost )
return false;
if( m_strCurrencySymbol != pOther->m_strCurrencySymbol ) if( m_strCurrencySymbol != pOther->m_strCurrencySymbol )
return false; return false;
} }
...@@ -288,7 +277,7 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive) ...@@ -288,7 +277,7 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive)
} }
} }
if( m_eType == enuMXFNumberCurrency && !m_bCurrencySymbolPost ) if( m_eType == enuMXFNumberCurrency )
{ {
if( !m_strCurrencySymbol.isEmpty() ) if( !m_strCurrencySymbol.isEmpty() )
{ {
...@@ -303,8 +292,8 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive) ...@@ -303,8 +292,8 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive)
{ {
pAttrList->Clear(); pAttrList->Clear();
pAttrList->AddAttribute("number:decimal-places", OUString::number(m_nDecimalDigits)); pAttrList->AddAttribute("number:decimal-places", OUString::number(m_nDecimalDigits));
pAttrList->AddAttribute("number:min-integer-digits", OUString::number(m_nMinInteger)); pAttrList->AddAttribute("number:min-integer-digits", OUString::number(1));
pAttrList->AddAttribute("number:min-exponent-digits", OUString::number(m_nMinExponent)); pAttrList->AddAttribute("number:min-exponent-digits", OUString::number(2));
pStrm->StartElement( "number:scientific-number" ); pStrm->StartElement( "number:scientific-number" );
pStrm->EndElement( "number:scientific-number" ); pStrm->EndElement( "number:scientific-number" );
} }
...@@ -312,7 +301,7 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive) ...@@ -312,7 +301,7 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive)
{ {
pAttrList->Clear(); pAttrList->Clear();
pAttrList->AddAttribute("number:decimal-places", OUString::number(m_nDecimalDigits)); pAttrList->AddAttribute("number:decimal-places", OUString::number(m_nDecimalDigits));
pAttrList->AddAttribute("number:min-integer-digits", OUString::number(m_nMinInteger)); pAttrList->AddAttribute("number:min-integer-digits", OUString::number(1));
if( m_bGroup ) if( m_bGroup )
pAttrList->AddAttribute("number:grouping","true"); pAttrList->AddAttribute("number:grouping","true");
...@@ -323,16 +312,6 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive) ...@@ -323,16 +312,6 @@ void XFNumberStyle::ToXml_Content(IXFStream *pStrm, bool nagetive)
pStrm->EndElement( "number:number" ); pStrm->EndElement( "number:number" );
} }
if( m_eType == enuMXFNumberCurrency && m_bCurrencySymbolPost )
{
if( !m_strCurrencySymbol.isEmpty() )
{
pStrm->StartElement( "number:currency-symbol" );
pStrm->Characters(m_strCurrencySymbol);
pStrm->EndElement( "number:currency-symbol" );
}
}
if( !nagetive ) if( !nagetive )
{ {
if( !m_strSuffix.isEmpty() ) if( !m_strSuffix.isEmpty() )
......
...@@ -67,13 +67,7 @@ ...@@ -67,13 +67,7 @@
XFParaStyle::XFParaStyle() XFParaStyle::XFParaStyle()
: m_eAlignType(enumXFAlignNone) : m_eAlignType(enumXFAlignNone)
, m_eLastLineAlign(enumXFAlignNone)
, m_bJustSingleWord(false)
, m_bKeepWithNext(false)
, m_fTextIndent(0) , m_fTextIndent(0)
, m_nPageNumber(0)
, m_bNumberLines(true)
, m_nLineNumberRestart(0)
, m_nFlag(0) , m_nFlag(0)
, m_bNumberRight(false) , m_bNumberRight(false)
{ {
...@@ -83,9 +77,6 @@ XFParaStyle::XFParaStyle() ...@@ -83,9 +77,6 @@ XFParaStyle::XFParaStyle()
XFParaStyle::XFParaStyle(const XFParaStyle& other) XFParaStyle::XFParaStyle(const XFParaStyle& other)
: XFStyle(other) : XFStyle(other)
, m_eAlignType(other.m_eAlignType) , m_eAlignType(other.m_eAlignType)
, m_eLastLineAlign(other.m_eLastLineAlign)
, m_bJustSingleWord(other.m_bJustSingleWord)
, m_bKeepWithNext(other.m_bKeepWithNext)
, m_fTextIndent(other.m_fTextIndent) , m_fTextIndent(other.m_fTextIndent)
, m_aBackColor(other.m_aBackColor) , m_aBackColor(other.m_aBackColor)
, m_aMargin(other.m_aMargin) , m_aMargin(other.m_aMargin)
...@@ -95,9 +86,6 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other) ...@@ -95,9 +86,6 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other)
, m_aDropcap(other.m_aDropcap) , m_aDropcap(other.m_aDropcap)
, m_aLineHeight(other.m_aLineHeight) , m_aLineHeight(other.m_aLineHeight)
, m_aBreaks(other.m_aBreaks) , m_aBreaks(other.m_aBreaks)
, m_nPageNumber(other.m_nPageNumber)
, m_bNumberLines(other.m_bNumberLines)
, m_nLineNumberRestart(other.m_nLineNumberRestart)
, m_nFlag(other.m_nFlag) , m_nFlag(other.m_nFlag)
, m_bNumberRight(other.m_bNumberRight) , m_bNumberRight(other.m_bNumberRight)
{ {
...@@ -134,12 +122,7 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other) ...@@ -134,12 +122,7 @@ XFParaStyle& XFParaStyle::operator=(const XFParaStyle& other)
m_strParentStyleName = other.m_strParentStyleName; m_strParentStyleName = other.m_strParentStyleName;
m_nFlag = other.m_nFlag; m_nFlag = other.m_nFlag;
m_eAlignType = other.m_eAlignType; m_eAlignType = other.m_eAlignType;
m_eLastLineAlign = other.m_eLastLineAlign;
m_bJustSingleWord = other.m_bJustSingleWord;
m_bKeepWithNext = other.m_bKeepWithNext;
m_fTextIndent = other.m_fTextIndent; m_fTextIndent = other.m_fTextIndent;
m_bNumberLines = other.m_bNumberLines;
m_nLineNumberRestart = other.m_nLineNumberRestart;
m_bNumberRight = other.m_bNumberRight; m_bNumberRight = other.m_bNumberRight;
m_pFont = other.m_pFont; m_pFont = other.m_pFont;
...@@ -301,21 +284,9 @@ bool XFParaStyle::Equal(IXFStyle *pStyle) ...@@ -301,21 +284,9 @@ bool XFParaStyle::Equal(IXFStyle *pStyle)
return false; return false;
if( m_fTextIndent != pOther->m_fTextIndent ) if( m_fTextIndent != pOther->m_fTextIndent )
return false; return false;
if( m_bJustSingleWord != pOther->m_bJustSingleWord )
return false;
if( m_bKeepWithNext != pOther->m_bKeepWithNext )
return false;
//line number:
if( m_bNumberLines != pOther->m_bNumberLines )
return false;
if( m_nLineNumberRestart != pOther->m_nLineNumberRestart )
return false;
//align: //align:
if( m_eAlignType != pOther->m_eAlignType ) if( m_eAlignType != pOther->m_eAlignType )
return false; return false;
//last line align:
if( m_eLastLineAlign != pOther->m_eLastLineAlign )
return false;
//shadow: //shadow:
if( m_aShadow != pOther->m_aShadow ) if( m_aShadow != pOther->m_aShadow )
...@@ -336,8 +307,6 @@ bool XFParaStyle::Equal(IXFStyle *pStyle) ...@@ -336,8 +307,6 @@ bool XFParaStyle::Equal(IXFStyle *pStyle)
//breaks: //breaks:
if( m_aBreaks != pOther->m_aBreaks ) if( m_aBreaks != pOther->m_aBreaks )
return false; return false;
if( m_nPageNumber != pOther->m_nPageNumber )
return false;
if( m_aTabs != pOther->m_aTabs ) if( m_aTabs != pOther->m_aTabs )
return false; return false;
...@@ -414,25 +383,9 @@ void XFParaStyle::ToXml(IXFStream *pStrm) ...@@ -414,25 +383,9 @@ void XFParaStyle::ToXml(IXFStream *pStrm)
{ {
pAttrList->AddAttribute("fo:text-align", GetAlignName(m_eAlignType) ); pAttrList->AddAttribute("fo:text-align", GetAlignName(m_eAlignType) );
} }
//last line align:
if( m_eLastLineAlign != enumXFAlignNone )
{
pAttrList->AddAttribute("fo:fo:text-align-last", GetAlignName(m_eLastLineAlign) );
if( m_bJustSingleWord )
pAttrList->AddAttribute("style:justify-single-word", "true" );
}
//line number: //line number:
if( m_bNumberLines ) pAttrList->AddAttribute( "text:number-lines", "true" );
{ pAttrList->AddAttribute( "text:line-number", OUString::number(0) );
pAttrList->AddAttribute( "text:number-lines", "true" );
pAttrList->AddAttribute( "text:line-number", OUString::number(m_nLineNumberRestart) );
}
else
{
pAttrList->AddAttribute( "text:number-lines", "false" );
assert(m_nLineNumberRestart>0);
pAttrList->AddAttribute( "text:line-number", "0" );
}
//shadow: //shadow:
m_aShadow.ToXml(pStrm); m_aShadow.ToXml(pStrm);
...@@ -451,15 +404,9 @@ void XFParaStyle::ToXml(IXFStream *pStrm) ...@@ -451,15 +404,9 @@ void XFParaStyle::ToXml(IXFStream *pStrm)
if( m_pFont.is() ) if( m_pFont.is() )
m_pFont->ToXml(pStrm); m_pFont->ToXml(pStrm);
//page number:
if( m_nPageNumber )
pAttrList->AddAttribute("fo:page-number", OUString::number(m_nPageNumber) );
//page breaks: //page breaks:
m_aBreaks.ToXml(pStrm); m_aBreaks.ToXml(pStrm);
if( m_bKeepWithNext )
pAttrList->AddAttribute("fo:fo:keep-with-next", "true" );
pStrm->StartElement("style:properties"); pStrm->StartElement("style:properties");
//dropcap: //dropcap:
......
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