xmloff/source/style/bordrhdl.cxx | 51 +++++++++++++-------------------------- 1 file changed, 17 insertions(+), 34 deletions(-)
New commits: commit c6a53777e6a83ffa89574295cd709b814c2d2a6b Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Sun Feb 2 18:23:48 2014 -0500 fdo#76697: Remove this duplicate and use the UNO constant values instead. (cherry picked from commit 72b2fafebfc44fa90f08cc198e2fa5fc26154c5b) Conflicts: xmloff/source/style/bordrhdl.cxx This fixes the bug because in XMLBorderHdl::importXML() the value "none" was rejected as invalid because API_LINE_NONE pointlessly had a different value than BorderLineStyle::NONE. Change-Id: Id81aacc6c594ad25d97f6f6dc578ed9ca16549ab Signed-off-by: Michael Stahl <mst...@redhat.com> (cherry picked from commit 7f3105323f1db11bc0a3ff5c5c71e1dc62338cc4) Reviewed-on: https://gerrit.libreoffice.org/8816 Reviewed-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index e0c7be5..cecc3b1 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -29,23 +29,6 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -const sal_uInt16 API_LINE_SOLID = 0; -const sal_uInt16 API_LINE_DOTTED = 1; -const sal_uInt16 API_LINE_DASHED = 2; -const sal_uInt16 API_LINE_DOUBLE = 3; -const sal_uInt16 API_LINE_THINTHICK_SMALLGAP = 4; -const sal_uInt16 API_LINE_THINTHICK_MEDIUMGAP = 5; -const sal_uInt16 API_LINE_THINTHICK_LARGEGAP = 6; -const sal_uInt16 API_LINE_THICKTHIN_SMALLGAP = 7; -const sal_uInt16 API_LINE_THICKTHIN_MEDIUMGAP = 8; -const sal_uInt16 API_LINE_THICKTHIN_LARGEGAP = 9; -const sal_uInt16 API_LINE_EMBOSSED = 10; -const sal_uInt16 API_LINE_ENGRAVED = 11; -const sal_uInt16 API_LINE_OUTSET = 12; -const sal_uInt16 API_LINE_INSET = 13; -const sal_uInt16 API_LINE_FINE_DASHED = 14; -const sal_uInt16 API_LINE_NONE = USHRT_MAX; - #define DEF_LINE_WIDTH_0 1 #define DEF_LINE_WIDTH_1 35 #define DEF_LINE_WIDTH_2 88 @@ -90,7 +73,7 @@ static sal_uInt16 const aBorderWidths[] = static void lcl_frmitems_setXMLBorderStyle( table::BorderLine2 & rBorderLine, sal_uInt16 nStyle ) { sal_Int16 eStyle = -1; // None - if ( nStyle != API_LINE_NONE ) + if (nStyle != table::BorderLineStyle::NONE) eStyle = sal_Int16( nStyle ); rBorderLine.LineStyle = eStyle; @@ -238,7 +221,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, co // if there is no style or a different style than none but no width, // then the declaration is not valid. - if( !bHasStyle || (API_LINE_NONE != nStyle && !bHasWidth) ) + if (!bHasStyle || (table::BorderLineStyle::NONE != nStyle && !bHasWidth)) return false; table::BorderLine2 aBorderLine; @@ -252,7 +235,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, co } // first of all, delete an empty line - if( (bHasStyle && API_LINE_NONE == nStyle) || + if ((bHasStyle && table::BorderLineStyle::NONE == nStyle) || (bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) ) { aBorderLine.InnerLineWidth = 0; @@ -312,34 +295,34 @@ bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, co XMLTokenEnum eStyleToken = XML_SOLID; switch ( aBorderLine.LineStyle ) { - case API_LINE_DASHED: + case table::BorderLineStyle::DASHED: eStyleToken = XML_DASHED; break; - case API_LINE_DOTTED: + case table::BorderLineStyle::DOTTED: eStyleToken = XML_DOTTED; break; - case API_LINE_DOUBLE: - case API_LINE_THINTHICK_SMALLGAP: - case API_LINE_THINTHICK_MEDIUMGAP: - case API_LINE_THINTHICK_LARGEGAP: - case API_LINE_THICKTHIN_SMALLGAP: - case API_LINE_THICKTHIN_MEDIUMGAP: - case API_LINE_THICKTHIN_LARGEGAP: + case table::BorderLineStyle::DOUBLE: + case table::BorderLineStyle::THINTHICK_SMALLGAP: + case table::BorderLineStyle::THINTHICK_MEDIUMGAP: + case table::BorderLineStyle::THINTHICK_LARGEGAP: + case table::BorderLineStyle::THICKTHIN_SMALLGAP: + case table::BorderLineStyle::THICKTHIN_MEDIUMGAP: + case table::BorderLineStyle::THICKTHIN_LARGEGAP: eStyleToken = XML_DOUBLE; break; - case API_LINE_EMBOSSED: + case table::BorderLineStyle::EMBOSSED: eStyleToken = XML_RIDGE; break; - case API_LINE_ENGRAVED: + case table::BorderLineStyle::ENGRAVED: eStyleToken = XML_GROOVE; break; - case API_LINE_OUTSET: + case table::BorderLineStyle::OUTSET: eStyleToken = XML_OUTSET; break; - case API_LINE_INSET: + case table::BorderLineStyle::INSET: eStyleToken = XML_INSET; break; - case API_LINE_FINE_DASHED: + case table::BorderLineStyle::FINE_DASHED: eStyleToken = XML_FINE_DASHED; break; case table::BorderLineStyle::DOUBLE_THIN:
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits