From 60b0526ea4929ce273de499f552a4d478a973d10 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Jan 2019 14:46:05 +0200 Subject: convert POR constants to scoped enum Change-Id: Ia146f1f932cf4437e2e7e20722b0957a458979fd Reviewed-on: https://gerrit.libreoffice.org/66514 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/qa/extras/layout/layout.cxx | 731 +++++++++++++----------- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 2 +- sw/qa/extras/rtfimport/rtfimport.cxx | 3 +- sw/qa/extras/uiwriter/uiwriter.cxx | 66 +-- sw/qa/extras/ww8export/ww8export.cxx | 6 +- sw/qa/extras/ww8export/ww8export2.cxx | 2 +- sw/source/core/access/accportions.cxx | 60 +- sw/source/core/access/accportions.hxx | 6 +- sw/source/core/inc/SwPortionHandler.hxx | 5 +- sw/source/core/inc/txttypes.hxx | 128 +++-- sw/source/core/text/EnhancedPDFExportHelper.cxx | 33 +- sw/source/core/text/inftxt.cxx | 32 +- sw/source/core/text/inftxt.hxx | 2 +- sw/source/core/text/itrform2.cxx | 8 +- sw/source/core/text/porexp.cxx | 4 +- sw/source/core/text/porexp.hxx | 4 +- sw/source/core/text/porfld.cxx | 20 +- sw/source/core/text/porfld.hxx | 2 +- sw/source/core/text/porfly.cxx | 2 +- sw/source/core/text/porfly.hxx | 2 +- sw/source/core/text/porftn.hxx | 2 +- sw/source/core/text/porglue.cxx | 8 +- sw/source/core/text/porhyph.hxx | 4 +- sw/source/core/text/porlay.cxx | 8 +- sw/source/core/text/porlin.cxx | 2 +- sw/source/core/text/porlin.hxx | 80 +-- sw/source/core/text/pormulti.cxx | 2 +- sw/source/core/text/pormulti.hxx | 2 +- sw/source/core/text/porref.cxx | 6 +- sw/source/core/text/porref.hxx | 2 +- sw/source/core/text/porrst.cxx | 16 +- sw/source/core/text/porrst.hxx | 6 +- sw/source/core/text/portab.hxx | 8 +- sw/source/core/text/portox.cxx | 6 +- sw/source/core/text/portox.hxx | 2 +- sw/source/core/text/portxt.cxx | 8 +- sw/source/core/text/portxt.hxx | 2 +- sw/source/core/text/txtdrop.cxx | 2 +- sw/source/core/text/txtftn.cxx | 10 +- sw/source/core/text/txthyph.cxx | 16 +- sw/source/core/text/txttab.cxx | 26 +- sw/source/core/text/xmldump.cxx | 128 ++--- 42 files changed, 761 insertions(+), 703 deletions(-) (limited to 'sw') diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index b4b27ccaf337..7ed24771c661 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -141,21 +141,25 @@ void SwLayoutWriter::CheckRedlineFootnotesHidden() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "24"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "13"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "Portion", "ac"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/merged", "paraPropsNodeIndex", "16"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "mo"); } @@ -193,57 +197,71 @@ void SwLayoutWriter::testRedlineFootnotes() xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[1]", "Portion", "a"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[2]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[3]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Text[3]", "Portion", "c"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "def"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Special[1]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Special[1]", "rText", "3"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", "ar"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Special[1]", "rText", "3"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[3]/txt[1]/Text[1]", "Portion", "ghi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[1]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[1]", "rText", "4"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[2]", "nType", "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Special[2]", "rText", "5"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Special[1]", "rText", "4"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[4]/txt[1]/Text[1]", "Portion", "jkl"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Special[1]", "nType", "POR_FTNNUM"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Special[1]", "nType", + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Special[1]", "rText", "5"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[1]", "Portion", "m"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[2]", "Portion", "n"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[3]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[3]", "Portion", "o"); // verify after hide @@ -325,12 +343,12 @@ void SwLayoutWriter::testRedlineFlysInBody() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "6"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); @@ -346,35 +364,35 @@ void SwLayoutWriter::testRedlineFlysInBody() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } @@ -401,7 +419,7 @@ void SwLayoutWriter::testRedlineFlysInBody() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); { // hide: no anchored object shown @@ -423,35 +441,35 @@ void SwLayoutWriter::testRedlineFlysInBody() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } @@ -477,12 +495,12 @@ void SwLayoutWriter::testRedlineFlysInBody() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "14"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "6"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); @@ -498,34 +516,34 @@ void SwLayoutWriter::testRedlineFlysInBody() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); } @@ -606,15 +624,15 @@ void SwLayoutWriter::testRedlineFlysInHeader() CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "foaz"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "11"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); @@ -630,37 +648,37 @@ void SwLayoutWriter::testRedlineFlysInHeader() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "Portion", "az"); } @@ -687,10 +705,10 @@ void SwLayoutWriter::testRedlineFlysInHeader() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); // now the frame has no Text portion? not sure why it's a 0-length one first and now none? - // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); // assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "foaz"); { // hide: no anchored object shown @@ -712,37 +730,37 @@ void SwLayoutWriter::testRedlineFlysInHeader() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "Portion", "bar"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "Portion", "az"); } @@ -767,15 +785,15 @@ void SwLayoutWriter::testRedlineFlysInHeader() CPPUNIT_ASSERT(pLayout->IsHideRedlines()); discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/merged", "paraPropsNodeIndex", "6"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "foaz"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "11"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); @@ -791,36 +809,36 @@ void SwLayoutWriter::testRedlineFlysInHeader() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nLength", "0"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/Text[2]", "Portion", "az"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/header/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); } @@ -922,18 +940,19 @@ void SwLayoutWriter::testRedlineFlysInFootnote() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "7"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "17"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -948,49 +967,56 @@ void SwLayoutWriter::testRedlineFlysInFootnote() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "quux"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "Portion", "az"); } @@ -1020,12 +1046,13 @@ void SwLayoutWriter::testRedlineFlysInFootnote() xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "7"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); { // hide: no anchored object shown @@ -1047,49 +1074,56 @@ void SwLayoutWriter::testRedlineFlysInFootnote() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "quux"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "Portion", "az"); } @@ -1119,18 +1153,19 @@ void SwLayoutWriter::testRedlineFlysInFootnote() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "25"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/merged", "paraPropsNodeIndex", "7"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/merged", "paraPropsNodeIndex", "17"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ahi"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -1145,49 +1180,56 @@ void SwLayoutWriter::testRedlineFlysInFootnote() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", "1"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", "POR_FTN"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "nType", + "PortionType::Footnote"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[2]", "rText", "2"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "quux"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "nType", - "POR_FTNNUM"); + "PortionType::FootnoteNum"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Special[1]", "rText", "2"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[2]/Text[1]", "Portion", "bar"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "a"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "bc"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[2]/txt[3]/Text[2]", "Portion", "az"); } } @@ -1298,18 +1340,18 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", "Portion", "jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_LAY"); + "PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "abhi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -1327,7 +1369,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", @@ -1335,7 +1377,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[2]", @@ -1343,7 +1385,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[2]/Text[1]", @@ -1351,7 +1393,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/Text[1]", @@ -1359,42 +1401,42 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[3]/Text[2]", "Portion", "qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } @@ -1431,7 +1473,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); { // hide: no anchored object shown @@ -1453,22 +1495,22 @@ void SwLayoutWriter::testRedlineFlysInFlys() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "kl"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/Text[1]", @@ -1476,7 +1518,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[1]/Text[2]", @@ -1484,7 +1526,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[2]/Text[1]", @@ -1492,7 +1534,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/Text[1]", @@ -1500,30 +1542,30 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/anchored[1]/fly[1]/txt[3]/Text[2]", "Portion", "hi"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_LAY"); + "PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "qr"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } @@ -1567,18 +1609,18 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/anchored[1]/fly[1]/txt[1]/Text[1]", "Portion", "jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_LAY"); + "PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "abhi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -1593,28 +1635,28 @@ void SwLayoutWriter::testRedlineFlysInFlys() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/Text[1]", @@ -1622,7 +1664,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[1]/Text[2]", @@ -1630,7 +1672,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[2]/Text[1]", @@ -1638,7 +1680,7 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/Text[1]", @@ -1646,24 +1688,24 @@ void SwLayoutWriter::testRedlineFlysInFlys() assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath( pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/anchored[1]/fly[1]/txt[3]/Text[2]", "Portion", "qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } } @@ -1757,17 +1799,17 @@ void SwLayoutWriter::testRedlineFlysAtFlys() "paraPropsNodeIndex", "11"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", "Portion", "jqr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_LAY"); + "PortionType::Lay"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "abhi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -1784,65 +1826,65 @@ void SwLayoutWriter::testRedlineFlysAtFlys() assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", "Portion", "j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[2]", "Portion", "kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/Text[1]", "Portion", "mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[1]", "Portion", "p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[2]", "Portion", "qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); // anchor to 2nd (deleted) paragraph @@ -1857,7 +1899,7 @@ void SwLayoutWriter::testRedlineFlysAtFlys() discardDumpedLayout(); pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "19"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz"); { // hide: no anchored object shown @@ -1879,67 +1921,67 @@ void SwLayoutWriter::testRedlineFlysAtFlys() xmlXPathFreeObject(pXmlObj); } - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[1]", "Portion", "j"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[1]/Text[2]", "Portion", "kl"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[2]/Text[1]", "Portion", "mno"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[1]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[1]", "Portion", "p"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[2]", - "nType", "POR_TXT"); + "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/anchored[1]/fly[1]/txt[3]/Text[2]", "Portion", "qr"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Special[1]", "nType", - "POR_FLY"); // remove??? + "PortionType::Fly"); // remove??? assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "ab"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[1]/Text[2]", "Portion", "c"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[2]/Text[1]", "Portion", "def"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[1]", "Portion", "g"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "nType", - "POR_TXT"); + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly[1]/txt[3]/Text[2]", "Portion", "hi"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "az"); } @@ -1948,10 +1990,11 @@ void SwLayoutWriter::CheckRedlineSectionsHidden() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "folah"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/merged", "paraPropsNodeIndex", "20"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "Portion", "folah"); } @@ -1991,32 +2034,39 @@ void SwLayoutWriter::testRedlineSections() xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "FRAME"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[1]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[2]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[1]/txt[2]/Text[1]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", "lah"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[1]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[2]/Text[1]", "nType", + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[2]/Text[1]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[1]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", "nType", + "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", "Portion", "lah"); // verify after hide @@ -2053,7 +2103,7 @@ void SwLayoutWriter::testRedlineTables() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foar"); lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {}); @@ -2068,28 +2118,28 @@ void SwLayoutWriter::testRedlineTables() xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "o"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", - "nType", "POR_PARA"); + "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion", "FRAME"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[1]/cell[1]/txt[1]/Text[1]", "Portion", "aaa"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/Text[1]", "nType", - "POR_PARA"); + "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/tab[1]/row[2]/cell[2]/txt[1]/Text[1]", "Portion", "ddd"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", "ar"); // verify after hide @@ -2100,7 +2150,7 @@ void SwLayoutWriter::testRedlineTables() discardDumpedLayout(); pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "12"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foar"); } @@ -2110,53 +2160,53 @@ void SwLayoutWriter::CheckRedlineCharAttributesHidden() discardDumpedLayout(); xmlDocPtr pXmlDoc = parseLayoutDump(); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged", "paraPropsNodeIndex", "9"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foobaz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/merged", "paraPropsNodeIndex", "10"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "foobaz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/merged", "paraPropsNodeIndex", "11"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/merged", "paraPropsNodeIndex", "12"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/merged", "paraPropsNodeIndex", "13"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/merged", "paraPropsNodeIndex", "14"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/merged", "paraPropsNodeIndex", "15"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/merged", "paraPropsNodeIndex", "16"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "Portion", "baz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/merged", "paraPropsNodeIndex", "17"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "Portion", "foobaz"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/merged", "paraPropsNodeIndex", "18"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "Portion", "ob"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "Portion", "az"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/merged", "paraPropsNodeIndex", "19"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "nType", "POR_PARA"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "nType", "PortionType::Para"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "Portion", "foobaz"); } @@ -2196,81 +2246,81 @@ void SwLayoutWriter::testRedlineCharAttributes() xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_EQUAL(0, xmlXPathNodeSetGetLength(pXmlNodes)); xmlXPathFreeObject(pXmlObj); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[3]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[4]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[5]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[6]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[7]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[2]", "Portion", "ba"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[3]", "Portion", "r"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[4]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[4]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[8]/Text[4]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[2]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[9]/Text[3]", "Portion", "baz"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[1]", "Portion", "fo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[2]", "Portion", "o"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[3]", "Portion", "bar"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[4]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[4]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[4]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[5]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[5]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[10]/Text[5]", "Portion", "az"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[1]", "Portion", "foo"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[2]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[2]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[2]", "Portion", "b"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[3]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[3]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[3]", "Portion", "a"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[4]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[4]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[4]", "Portion", "r"); - assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[5]", "nType", "POR_TXT"); + assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[5]", "nType", "PortionType::Text"); assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[5]", "Portion", "baz"); // verify after hide @@ -2493,7 +2543,8 @@ void SwLayoutWriter::testTdf117923() // Check that we actually test the line we need assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI"); - assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nType", "POR_NUMBER"); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nType", + "PortionType::Number"); assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "rText", "2."); // The numbering height was 960. assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "220"); @@ -2528,7 +2579,8 @@ void SwLayoutWriter::testUserFieldTypeLanguage() xmlDocPtr pXmlDoc = parseLayoutDump(); // This was "123,456.00", via a buggy 1234.56 -> 1234,56 -> 123456 -> // 123,456.00 transform chain. - assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='POR_FLD']", "rText", "1,234.56"); + assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='PortionType::Field']", "rText", + "1,234.56"); } void SwLayoutWriter::testTdf109137() @@ -2600,7 +2652,7 @@ void SwLayoutWriter::testTdf117187() xmlDocPtr pXmlDoc = parseLayoutDump(); // there should be no fly portions - assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='POR_FLY']", 0); + assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='PortionType::Fly']", 0); } void SwLayoutWriter::testTdf119875() @@ -2633,7 +2685,8 @@ void SwLayoutWriter::testTdf120287b() // This was 1418, TabOverMargin did the right split of the paragraph to two // lines, but then calculated a too large tab portion size on the first // line. - assertXPath(pXmlDoc, "/root/page/body/txt[1]/Text[@nType='POR_TABRIGHT']", "nWidth", "17"); + assertXPath(pXmlDoc, "/root/page/body/txt[1]/Text[@nType='PortionType::TabRight']", "nWidth", + "17"); } void SwLayoutWriter::testTdf120287c() diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c5d6b88db4b2..49a6706a9f3d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -774,7 +774,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(2), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["ParentNumbering"].get()); // The paragraph marker's red font color was inherited by the number portion, this was ff0000. - CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), parseDump("//Special[@nType='POR_NUMBER']/SwFont", "color")); + CPPUNIT_ASSERT_EQUAL(OUString("ffffffff"), parseDump("//Special[@nType='PortionType::Number']/SwFont", "color")); } DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx") diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index c31bebbd735f..4672c1910d08 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -350,7 +350,8 @@ DECLARE_RTFIMPORT_TEST(testTdf112211_2, "tdf112211-2.rtf") { // Spacing between the bullet and the actual text was too large. // This is now around 269, large old value was 629. - int nWidth = parseDump("/root/page/body/txt[2]/Text[@nType='POR_TABLEFT']", "nWidth").toInt32(); + int nWidth = parseDump("/root/page/body/txt[2]/Text[@nType='PortionType::TabLeft']", "nWidth") + .toInt32(); CPPUNIT_ASSERT_LESS(300, nWidth); } diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 5e9d9c639f75..730a3710cb50 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1807,7 +1807,7 @@ void SwUiWriterTest::testTdf90003() CPPUNIT_ASSERT(pXmlDoc); // This was 1: an unexpected fly portion was created, resulting in too // large x position for the empty paragraph marker. - assertXPath(pXmlDoc, "//Special[@nType='POR_FLY']", 0); + assertXPath(pXmlDoc, "//Special[@nType='PortionType::Fly']", 0); } void SwUiWriterTest::testTdf51741() @@ -4208,7 +4208,7 @@ void SwUiWriterTest::testTdf87922() struct PortionItem { PortionItem(OUString const & sItemType, sal_Int32 nLength, - sal_uInt16 nTextType) + PortionType nTextType) : msItemType(sItemType) , mnLength(nLength) , mnTextType(nTextType) @@ -4216,7 +4216,7 @@ struct PortionItem OUString msItemType; sal_Int32 mnLength; - sal_uInt16 mnTextType; + PortionType mnTextType; }; class PortionHandler : public SwPortionHandler @@ -4233,14 +4233,14 @@ class PortionHandler : public SwPortionHandler mPortionItems.clear(); } - virtual void Text(TextFrameIndex nLength, sal_uInt16 nType, + virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/) override { mPortionItems.emplace_back("text", sal_Int32(nLength), nType); } virtual void Special(TextFrameIndex nLength, const OUString & /*rText*/, - sal_uInt16 nType, sal_Int32 /*nHeight*/, + PortionType nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/, const SwFont* /*pFont*/) override { mPortionItems.emplace_back("special", sal_Int32(nLength), nType); @@ -4248,17 +4248,17 @@ class PortionHandler : public SwPortionHandler virtual void LineBreak(sal_Int32 /*nWidth*/) override { - mPortionItems.emplace_back("line_break", 0, 0); + mPortionItems.emplace_back("line_break", 0, PortionType::NONE); } virtual void Skip(TextFrameIndex nLength) override { - mPortionItems.emplace_back("skip", sal_Int32(nLength), 0); + mPortionItems.emplace_back("skip", sal_Int32(nLength), PortionType::NONE); } virtual void Finish() override { - mPortionItems.emplace_back("finish", 0, 0); + mPortionItems.emplace_back("finish", 0, PortionType::NONE); } }; @@ -4283,7 +4283,7 @@ void SwUiWriterTest::testTdf77014() // Input Field - "One Two Three Four Five" = 25 chars CPPUNIT_ASSERT_EQUAL(OUString("text"), aHandler.mPortionItems[0].msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(25), aHandler.mPortionItems[0].mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_INPUTFLD), aHandler.mPortionItems[0].mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::InputField, aHandler.mPortionItems[0].mnTextType); CPPUNIT_ASSERT_EQUAL(OUString("line_break"), aHandler.mPortionItems[1].msItemType); @@ -4299,7 +4299,7 @@ void SwUiWriterTest::testTdf77014() // Input Field - "ThisIsAllOneWord" = 18 chars CPPUNIT_ASSERT_EQUAL(OUString("text"), aHandler.mPortionItems[0].msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(18), aHandler.mPortionItems[0].mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_INPUTFLD), aHandler.mPortionItems[0].mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::InputField, aHandler.mPortionItems[0].mnTextType); CPPUNIT_ASSERT_EQUAL(OUString("line_break"), aHandler.mPortionItems[1].msItemType); @@ -4320,7 +4320,7 @@ void SwUiWriterTest::testTdf77014() auto& rPortionItem = aHandler.mPortionItems[0]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(91), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_TXT), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::Text, rPortionItem.mnTextType); // NEW LINE rPortionItem = aHandler.mPortionItems[1]; @@ -4332,13 +4332,13 @@ void SwUiWriterTest::testTdf77014() rPortionItem = aHandler.mPortionItems[2]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(18), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_INPUTFLD), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::InputField, rPortionItem.mnTextType); // Text "." rPortionItem = aHandler.mPortionItems[3]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_TXT), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::Text, rPortionItem.mnTextType); // NEW LINE rPortionItem = aHandler.mPortionItems[4]; @@ -4361,7 +4361,7 @@ void SwUiWriterTest::testTdf77014() printf ("-- Type: %s length: %" SAL_PRIdINT32 " text type: %d\n", rPortionItem.msItemType.toUtf8().getStr(), rPortionItem.mnLength, - rPortionItem.mnTextType); + sal_uInt16(rPortionItem.mnTextType)); } // Text "The purpose of this report is to summarize the results of the existing bug in the LO suite" @@ -4369,7 +4369,7 @@ void SwUiWriterTest::testTdf77014() auto& rPortionItem = aHandler.mPortionItems[0]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(91), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_TXT), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::Text, rPortionItem.mnTextType); // The input field here has more words ("One Two Three Four Five") // and it should break after "Two". @@ -4377,12 +4377,12 @@ void SwUiWriterTest::testTdf77014() rPortionItem = aHandler.mPortionItems[1]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(8), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_INPUTFLD), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::InputField, rPortionItem.mnTextType); rPortionItem = aHandler.mPortionItems[2]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_HOLE), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::Hole, rPortionItem.mnTextType); // NEW LINE rPortionItem = aHandler.mPortionItems[3]; @@ -4392,13 +4392,13 @@ void SwUiWriterTest::testTdf77014() rPortionItem = aHandler.mPortionItems[4]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(16), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_INPUTFLD), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::InputField, rPortionItem.mnTextType); // Text "." rPortionItem = aHandler.mPortionItems[5]; CPPUNIT_ASSERT_EQUAL(OUString("text"), rPortionItem.msItemType); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), rPortionItem.mnLength); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(POR_TXT), rPortionItem.mnTextType); + CPPUNIT_ASSERT_EQUAL(PortionType::Text, rPortionItem.mnTextType); // NEW LINE rPortionItem = aHandler.mPortionItems[6]; @@ -5515,16 +5515,16 @@ void SwUiWriterTest::testTdf35021_tabOverMarginDemo() // Tabs should go past the margin @ ~3381 sal_Int32 nMargin = getXPath(pXmlDoc, "//body/txt[1]/infos/prtBounds", "width").toInt32(); // left tab was 3381 because it got its own full line - sal_Int32 nWidth = getXPath(pXmlDoc, "//Text[@nType='POR_TABLEFT']", "nWidth").toInt32(); + sal_Int32 nWidth = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabLeft']", "nWidth").toInt32(); CPPUNIT_ASSERT_MESSAGE("Left Tab width is ~4479", nMargin < nWidth); // center tab was 842 - nWidth = getXPath(pXmlDoc, "//Text[@nType='POR_TABCENTER']", "nWidth").toInt32(); + nWidth = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabCenter']", "nWidth").toInt32(); CPPUNIT_ASSERT_MESSAGE("Center Tab width is ~3521", nMargin < nWidth); // right tab was probably the same as center tab. - nWidth = getXPath(pXmlDoc, "//Text[@nType='POR_TABRIGHT']", "nWidth").toInt32(); + nWidth = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabRight']", "nWidth").toInt32(); CPPUNIT_ASSERT_MESSAGE("Right Tab width is ~2907", sal_Int32(2500) < nWidth); // decimal tab was 266 - nWidth = getXPath(pXmlDoc, "//Text[@nType='POR_TABDECIMAL']", "nWidth").toInt32(); + nWidth = getXPath(pXmlDoc, "//Text[@nType='PortionType::TabDecimal']", "nWidth").toInt32(); CPPUNIT_ASSERT_MESSAGE("Decimal Tab width is ~4096", nMargin < nWidth); } #endif @@ -5559,18 +5559,18 @@ void SwUiWriterTest::testTdf107025() createDoc("tdf107025.odt"); xmlDocPtr pXmlDoc = parseLayoutDump(); // Verify the number of characters in each line. - CPPUNIT_ASSERT_EQUAL( sal_Int32(1), getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]", "nLength").toInt32()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(9), getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[2]", "nLength").toInt32()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]", "nLength").toInt32()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(9), getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[2]", "nLength").toInt32()); // Do the subsequent test only if the first line can be displayed, // in case that the required font does not exist. - sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]", "nWidth").toInt32(); + sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]", "nWidth").toInt32(); if (!nWidth1) return; - CPPUNIT_ASSERT(!parseDump("(//Text[@nType='POR_TXT'])[2]", "nWidth").isEmpty()); + CPPUNIT_ASSERT(!parseDump("(//Text[@nType='PortionType::Text'])[2]", "nWidth").isEmpty()); // Width of the second line is expected to be 9 times of the first. - sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[2]", "nWidth").toInt32(); + sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[2]", "nWidth").toInt32(); CPPUNIT_ASSERT_EQUAL( sal_Int32(9), nWidth2 / nWidth1 ); } @@ -5579,9 +5579,9 @@ void SwUiWriterTest::testTdf107362() { createDoc("tdf107362.odt"); xmlDocPtr pXmlDoc = parseLayoutDump(); - sal_Int32 nHeight = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]" , "nHeight").toInt32(); - sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[1]" , "nWidth").toInt32(); - sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='POR_TXT'])[2]" , "nWidth").toInt32(); + sal_Int32 nHeight = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]" , "nHeight").toInt32(); + sal_Int32 nWidth1 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[1]" , "nWidth").toInt32(); + sal_Int32 nWidth2 = getXPath(pXmlDoc, "(//Text[@nType='PortionType::Text'])[2]" , "nWidth").toInt32(); sal_Int32 nLineWidth = getXPath(pXmlDoc, "//LineBreak" , "nWidth").toInt32(); sal_Int32 nKernWidth = nLineWidth - nWidth1 - nWidth2; // Test only if fonts are available @@ -5651,7 +5651,7 @@ void SwUiWriterTest::testTdf106736() { createDoc("tdf106736-grid.odt"); xmlDocPtr pXmlDoc = parseLayoutDump(); - sal_Int32 nWidth = getXPath(pXmlDoc, "(//Text[@nType='POR_TABLEFT'])[1]", "nWidth").toInt32(); + sal_Int32 nWidth = getXPath(pXmlDoc, "(//Text[@nType='PortionType::TabLeft'])[1]", "nWidth").toInt32(); // In tdf106736, width of tab overflow so that it got // width value around 9200, expected value is around 103 CPPUNIT_ASSERT_MESSAGE("Left Tab width is ~103", nWidth < 150); @@ -5736,7 +5736,7 @@ void SwUiWriterTest::testTdf58604() // Allow linebreak character follows hanging punctuation immediately instead of // breaking at the start of the next line. load(DATA_DIRECTORY, "tdf58604.odt"); - CPPUNIT_ASSERT_EQUAL( OUString("POR_BRK"), parseDump( "(/root/page/body/txt/LineBreak[1]/preceding::Text)[last()]", "nType" ) ); + CPPUNIT_ASSERT_EQUAL( OUString("PortionType::Break"), parseDump( "(/root/page/body/txt/LineBreak[1]/preceding::Text)[last()]", "nType" ) ); #endif } diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index bac74e82d83a..48461ff527a6 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -305,7 +305,7 @@ DECLARE_WW8EXPORT_TEST(testN823651, "n823651.doc") DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc") { - OUString aText = parseDump("/root/page/body/txt[3]/Special[@nType='POR_NUMBER']", "rText"); + OUString aText = parseDump("/root/page/body/txt[3]/Special[@nType='PortionType::Number']", "rText"); // This was 1.1. CPPUNIT_ASSERT_EQUAL(OUString("2.1"), aText); } @@ -313,8 +313,8 @@ DECLARE_WW8EXPORT_TEST(testFdo36868, "fdo36868.doc") DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc") { // Similar to fdo#36868, numbering portions had wrong values. - OUString aText = parseDump("/root/page/body/txt[1]/Special[@nType='POR_NUMBER']", "rText"); - // POR_NUMBER was completely missing. + OUString aText = parseDump("/root/page/body/txt[1]/Special[@nType='PortionType::Number']", "rText"); + // PortionType::Number was completely missing. CPPUNIT_ASSERT_EQUAL(OUString("1."), aText); } diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 9154d45350ab..5e189944b8ed 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -100,7 +100,7 @@ DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc") DECLARE_WW8EXPORT_TEST(testTdf49102_mergedCellNumbering, "tdf49102_mergedCellNumbering.doc") { - CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='POR_NUMBER']", "rText") ); + CPPUNIT_ASSERT_EQUAL( OUString("2."), parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='PortionType::Number']", "rText") ); } DECLARE_WW8EXPORT_TEST(testTdf55427_footnote2endnote, "tdf55427_footnote2endnote.odt") diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index a5cac3f6f6b6..f71974ace562 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -59,7 +59,7 @@ using namespace ::com::sun::star; using i18n::Boundary; // 'portion type' for terminating portions -#define POR_TERMINATE 0 +#define POR_TERMINATE PortionType::NONE // portion attributes #define PORATTR_SPECIAL 1 @@ -109,7 +109,7 @@ SwAccessiblePortionData::~SwAccessiblePortionData() } void SwAccessiblePortionData::Text(TextFrameIndex const nLength, - sal_uInt16 nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/) + PortionType nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/) { OSL_ENSURE((m_nViewPosition + nLength) <= TextFrameIndex(m_pTextFrame->GetText().getLength()), "portion exceeds model string!" ); @@ -134,7 +134,7 @@ void SwAccessiblePortionData::Text(TextFrameIndex const nLength, } void SwAccessiblePortionData::Special( - TextFrameIndex const nLength, const OUString& rText, sal_uInt16 nType, + TextFrameIndex const nLength, const OUString& rText, PortionType nType, sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/, const SwFont* /*pFont*/) { OSL_ENSURE(m_nViewPosition >= TextFrameIndex(0), "illegal position"); @@ -148,14 +148,14 @@ void SwAccessiblePortionData::Special( OUString sDisplay; switch( nType ) { - case POR_POSTITS: - case POR_FLYCNT: + case PortionType::PostIts: + case PortionType::FlyCnt: sDisplay = OUString(u'\xfffc'); break; - case POR_FLD: - case POR_HIDDEN: - case POR_COMBINED: - case POR_ISOREF: + case PortionType::Field: + case PortionType::Hidden: + case PortionType::Combined: + case PortionType::IsoRef: // When the field content is empty, input a special character. if (rText.isEmpty()) sDisplay = OUString(u'\xfffc'); @@ -164,9 +164,9 @@ void SwAccessiblePortionData::Special( m_aFieldPosition.push_back(m_aBuffer.getLength()); m_aFieldPosition.push_back(m_aBuffer.getLength() + rText.getLength()); break; - case POR_FTNNUM: + case PortionType::FootnoteNum: break; - case POR_FTN: + case PortionType::Footnote: { sDisplay = rText; sal_Int32 nStart=m_aBuffer.getLength(); @@ -175,16 +175,16 @@ void SwAccessiblePortionData::Special( break; } break; - case POR_NUMBER: - case POR_BULLET: + case PortionType::Number: + case PortionType::Bullet: sDisplay = rText + " "; break; // There should probably be some special treatment to graphical bullets - case POR_GRFNUM: + case PortionType::GrfNum: break; // #i111768# - apply patch from kstribley: // Include the control characters. - case POR_CONTROLCHAR: + case PortionType::ControlChar: sDisplay = rText + OUStringLiteral1(m_pTextFrame->GetText()[sal_Int32(m_nViewPosition)]); break; default: @@ -263,30 +263,30 @@ bool SwAccessiblePortionData::IsSpecialPortion( size_t nPortionNo ) const return IsPortionAttrSet(nPortionNo, PORATTR_SPECIAL); } -bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const +bool SwAccessiblePortionData::IsGrayPortionType( PortionType nType ) const { // gray portions? // Compare with: inftxt.cxx, SwTextPaintInfo::DrawViewOpt(...) bool bGray = false; switch( nType ) { - case POR_FTN: - case POR_ISOREF: - case POR_REF: - case POR_QUOVADIS: - case POR_NUMBER: - case POR_FLD: - case POR_URL: - case POR_INPUTFLD: - case POR_ISOTOX: - case POR_TOX: - case POR_HIDDEN: + case PortionType::Footnote: + case PortionType::IsoRef: + case PortionType::Ref: + case PortionType::QuoVadis: + case PortionType::Number: + case PortionType::Field: + case PortionType::Url: + case PortionType::InputField: + case PortionType::IsoTox: + case PortionType::Tox: + case PortionType::Hidden: bGray = !m_pViewOptions->IsPagePreview() && !m_pViewOptions->IsReadonly() && SwViewOption::IsFieldShadings(); break; - case POR_TAB: bGray = m_pViewOptions->IsTab(); break; - case POR_SOFTHYPH: bGray = m_pViewOptions->IsSoftHyph(); break; - case POR_BLANK: bGray = m_pViewOptions->IsHardBlank(); break; + case PortionType::Table: bGray = m_pViewOptions->IsTab(); break; + case PortionType::SoftHyphen: bGray = m_pViewOptions->IsSoftHyph(); break; + case PortionType::Blank: bGray = m_pViewOptions->IsHardBlank(); break; default: break; // bGray is false } diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index c1486eb8bca1..c64a45d2afbd 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -79,7 +79,7 @@ class SwAccessiblePortionData : public SwPortionHandler /// Access to portion attributes bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const; bool IsSpecialPortion( size_t nPortionNo ) const; - bool IsGrayPortionType( sal_uInt16 nType ) const; + bool IsGrayPortionType( PortionType nType ) const; // helper method for GetEditableRange(...): void AdjustAndCheck( sal_Int32 nPos, size_t& nPortionNo, @@ -91,8 +91,8 @@ public: virtual ~SwAccessiblePortionData() override; // SwPortionHandler methods - virtual void Text(TextFrameIndex nLength, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0) override; - virtual void Special(TextFrameIndex nLength, const OUString& rText, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0, const SwFont* pFont = nullptr) override; + virtual void Text(TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0) override; + virtual void Special(TextFrameIndex nLength, const OUString& rText, PortionType nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0, const SwFont* pFont = nullptr) override; virtual void LineBreak(sal_Int32 nWidth) override; virtual void Skip(TextFrameIndex nLength) override; virtual void Finish() override; diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx index 6596030f3c82..0a2e4eeb6aea 100644 --- a/sw/source/core/inc/SwPortionHandler.hxx +++ b/sw/source/core/inc/SwPortionHandler.hxx @@ -24,6 +24,7 @@ #include "TextFrameIndex.hxx" class SwFont; +enum class PortionType; /** The SwPortionHandler interface implements a visitor for the layout * engine's text portions. This can be used to gather information of @@ -56,7 +57,7 @@ public: */ virtual void Text( TextFrameIndex nLength, ///< length of this portion in the view string - sal_uInt16 nType, /// type of this portion + PortionType nType, /// type of this portion sal_Int32 nHeight = 0, /// height of this portion sal_Int32 nWidth = 0 /// width of this portion ) = 0; @@ -69,7 +70,7 @@ public: virtual void Special( TextFrameIndex nLength, ///< length of this portion in the view string const OUString& rText, /// text which is painted on-screen - sal_uInt16 nType, /// type of this portion + PortionType nType, /// type of this portion sal_Int32 nHeight = 0, /// font height of the painted text sal_Int32 nWidth = 0, /// width of this portion const SwFont* pFont = nullptr /// font of this portion diff --git a/sw/source/core/inc/txttypes.hxx b/sw/source/core/inc/txttypes.hxx index 1633afc07f69..511a3160c6bf 100644 --- a/sw/source/core/inc/txttypes.hxx +++ b/sw/source/core/inc/txttypes.hxx @@ -21,69 +21,71 @@ #include -// Portiontypen -#define POR_LIN 0x0000 -#define POR_FLYCNT 0x0001 - -#define POR_HOLE 0x0080 -#define POR_TMPEND 0x0081 -#define POR_BRK 0x0082 -#define POR_KERN 0x0083 -#define POR_ARROW 0x0084 -#define POR_MULTI 0x0085 -#define POR_HIDDEN_TXT 0x0086 -#define POR_CONTROLCHAR 0x0087 - -#define POR_TXT 0x8000 -#define POR_LAY 0x8001 -#define POR_PARA 0x8002 -#define POR_URL 0x8003 -#define POR_HNG 0x8004 -#define POR_INPUTFLD 0x8005 - -#define POR_DROP 0x8080 -#define POR_TOX 0x8089 -#define POR_ISOTOX 0x808a -#define POR_REF 0x808b -#define POR_ISOREF 0x808c -#define POR_META 0x808d - -#define POR_EXP 0xc080 -#define POR_BLANK 0xc081 -#define POR_POSTITS 0xc082 - -#define POR_HYPH 0xd080 -#define POR_HYPHSTR 0xd081 -#define POR_SOFTHYPH 0xd082 -#define POR_SOFTHYPHSTR 0xd083 -#define POR_SOFTHYPH_COMP 0xd084 - -#define POR_FLD 0xe080 -#define POR_HIDDEN 0xe081 -#define POR_QUOVADIS 0xe082 -#define POR_ERGOSUM 0xe083 -#define POR_COMBINED 0xe084 -#define POR_FTN 0xe085 - -#define POR_FTNNUM 0xe880 -#define POR_NUMBER 0xe881 -#define POR_BULLET 0xe882 -#define POR_GRFNUM 0xe883 - -#define POR_GLUE 0x0480 - -#define POR_MARGIN 0x04c0 - -#define POR_FIX 0x06c0 -#define POR_FLY 0x06c1 - -#define POR_TAB 0x0750 - -#define POR_TABRIGHT 0x07d0 -#define POR_TABCENTER 0x07d1 -#define POR_TABDECIMAL 0x07d2 - -#define POR_TABLEFT 0x0740 +enum class PortionType +{ + NONE = 0x0000, + FlyCnt = 0x0001, + + Hole = 0x0080, + TempEnd = 0x0081, + Break = 0x0082, + Kern = 0x0083, + Arrow = 0x0084, + Multi = 0x0085, + HiddenText = 0x0086, + ControlChar = 0x0087, + + Text = 0x8000, + Lay = 0x8001, + Para = 0x8002, + Url = 0x8003, + Hanging = 0x8004, + InputField = 0x8005, + + Drop = 0x8080, + Tox = 0x8089, + IsoTox = 0x808a, + Ref = 0x808b, + IsoRef = 0x808c, + Meta = 0x808d, + + Expand = 0xc080, + Blank = 0xc081, + PostIts = 0xc082, + + Hyphen = 0xd080, + HyphenStr = 0xd081, + SoftHyphen = 0xd082, + SoftHyphenStr = 0xd083, + SoftHyphenComp = 0xd084, + + Field = 0xe080, + Hidden = 0xe081, + QuoVadis = 0xe082, + ErgoSum = 0xe083, + Combined = 0xe084, + Footnote = 0xe085, + + FootnoteNum = 0xe880, + Number = 0xe881, + Bullet = 0xe882, + GrfNum = 0xe883, + + Glue = 0x0480, + + Margin = 0x04c0, + + Fix = 0x06c0, + Fly = 0x06c1, + + Table = 0x0750, + + TabRight = 0x07d0, + TabCenter = 0x07d1, + TabDecimal = 0x07d2, + + TabLeft = 0x0740, +}; #endif // INCLUDED_SW_SOURCE_CORE_INC_TXTTYPES_HXX diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index e4312738c5b2..69395167a38f 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -732,8 +732,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) case vcl::PDFWriter::Span : case vcl::PDFWriter::Quote : case vcl::PDFWriter::Code : - if( POR_HYPHSTR == pPor->GetWhichPor() || POR_SOFTHYPHSTR == pPor->GetWhichPor() || - POR_HYPH == pPor->GetWhichPor() || POR_SOFTHYPH == pPor->GetWhichPor() ) + if( PortionType::HyphenStr == pPor->GetWhichPor() || PortionType::SoftHyphenStr == pPor->GetWhichPor() || + PortionType::Hyphen == pPor->GetWhichPor() || PortionType::SoftHyphen == pPor->GetWhichPor() ) bActualText = true; else { @@ -757,7 +757,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) if ( bActualText ) { OUString aActualText; - if (pPor->GetWhichPor() == POR_SOFTHYPH || pPor->GetWhichPor() == POR_HYPH) + if (pPor->GetWhichPor() == PortionType::SoftHyphen || pPor->GetWhichPor() == PortionType::Hyphen) aActualText = OUString(u'\x00ad'); // soft hyphen else aActualText = rInf.GetText().copy(sal_Int32(rInf.GetIdx()), sal_Int32(pPor->GetLen())); @@ -1319,18 +1319,18 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() switch ( pPor->GetWhichPor() ) { - case POR_HYPH : - case POR_SOFTHYPH : + case PortionType::Hyphen : + case PortionType::SoftHyphen : // Check for alternative spelling: - case POR_HYPHSTR : - case POR_SOFTHYPHSTR : + case PortionType::HyphenStr : + case PortionType::SoftHyphenStr : nPDFType = vcl::PDFWriter::Span; aPDFType = aSpanString; break; - case POR_LAY : - case POR_TXT : - case POR_PARA : + case PortionType::Lay : + case PortionType::Text : + case PortionType::Para : { std::pair const pos( pFrame->MapViewToModel(rInf.GetIdx())); @@ -1391,12 +1391,12 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() } break; - case POR_FTN : + case PortionType::Footnote : nPDFType = vcl::PDFWriter::Link; aPDFType = aLinkString; break; - case POR_FLD : + case PortionType::Field : { // check field type: TextFrameIndex const nIdx = static_cast(pPor)->IsFollow() @@ -1420,12 +1420,13 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() } break; - case POR_TAB : - case POR_TABRIGHT : - case POR_TABCENTER : - case POR_TABDECIMAL : + case PortionType::Table : + case PortionType::TabRight : + case PortionType::TabCenter : + case PortionType::TabDecimal : nPDFType = vcl::PDFWriter::NonStructElement; break; + default: break; } if ( USHRT_MAX != nPDFType ) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index b3318f656fad..2b9bdee32440 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1270,33 +1270,33 @@ void SwTextPaintInfo::DrawBorder( const SwLinePortion &rPor ) const } void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor, - const sal_uInt16 nWhich ) const + PortionType nWhich ) const { if( OnWin() && !IsMulti() ) { bool bDraw = false; switch( nWhich ) { - case POR_FTN: - case POR_QUOVADIS: - case POR_NUMBER: - case POR_FLD: - case POR_URL: - case POR_HIDDEN: - case POR_TOX: - case POR_REF: - case POR_META: - case POR_CONTROLCHAR: + case PortionType::Footnote: + case PortionType::QuoVadis: + case PortionType::Number: + case PortionType::Field: + case PortionType::Url: + case PortionType::Hidden: + case PortionType::Tox: + case PortionType::Ref: + case PortionType::Meta: + case PortionType::ControlChar: if ( !GetOpt().IsPagePreview() && !GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() - && ( POR_NUMBER != nWhich + && ( PortionType::Number != nWhich || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) // #i27615# { bDraw = true; } break; - case POR_INPUTFLD: + case PortionType::InputField: // input field shading also in read-only mode if ( !GetOpt().IsPagePreview() && SwViewOption::IsFieldShadings() ) @@ -1304,13 +1304,13 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor, bDraw = true; } break; - case POR_TAB: + case PortionType::Table: if ( GetOpt().IsTab() ) bDraw = true; break; - case POR_SOFTHYPH: + case PortionType::SoftHyphen: if ( GetOpt().IsSoftHyph() )bDraw = true; break; - case POR_BLANK: + case PortionType::Blank: if ( GetOpt().IsHardBlank())bDraw = true; break; default: diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index d7a826635dc0..48f8400af8ca 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -414,7 +414,7 @@ public: void DrawRedArrow( const SwLinePortion &rPor ) const; void DrawPostIts( bool bScript ) const; void DrawBackground( const SwLinePortion &rPor ) const; - void DrawViewOpt( const SwLinePortion &rPor, const sal_uInt16 nWhich ) const; + void DrawViewOpt( const SwLinePortion &rPor, PortionType nWhich ) const; void DrawBackBrush( const SwLinePortion &rPor ) const; /** diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 56ec331f1b6b..be10f475fe06 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -261,7 +261,7 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf ) { if( pPor->InTextGrp() && !pPor->InExpGrp() ) { - const sal_uInt16 nOldWhich = m_pCurr->GetWhichPor(); + const PortionType nOldWhich = m_pCurr->GetWhichPor(); *static_cast(m_pCurr) = *pPor; m_pCurr->SetNextPortion( pPor->GetNextPortion() ); m_pCurr->SetWhichPor( nOldWhich ); @@ -829,7 +829,7 @@ void SwTextFormatter::CalcAscent( SwTextFormatInfo &rInf, SwLinePortion *pPor ) class SwMetaPortion : public SwTextPortion { public: - SwMetaPortion() { SetWhichPor( POR_META ); } + SwMetaPortion() { SetWhichPor( PortionType::Meta ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; }; @@ -837,7 +837,7 @@ void SwMetaPortion::Paint( const SwTextPaintInfo &rInf ) const { if ( Width() ) { - rInf.DrawViewOpt( *this, POR_META ); + rInf.DrawViewOpt( *this, PortionType::Meta ); SwTextPortion::Paint( rInf ); } } @@ -1340,7 +1340,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf ) // aligned at the tab stop position. We store the width from the beginning of // the tab stop portion up to the portion containing the decimal separator: if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT) /*rInf.GetVsh()->IsTabCompat();*/ && - POR_TABDECIMAL == pLastTabPortion->GetWhichPor() ) + PortionType::TabDecimal == pLastTabPortion->GetWhichPor() ) { OSL_ENSURE( rInf.X() >= pLastTabPortion->GetFix(), "Decimal tab stop position cannot be calculated" ); const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = static_cast(rInf.X() - pLastTabPortion->GetFix() ); diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx index 67e516ca2daf..2e090c5992e6 100644 --- a/sw/source/core/text/porexp.cxx +++ b/sw/source/core/text/porexp.cxx @@ -195,7 +195,7 @@ bool SwBlankPortion::Format( SwTextFormatInfo &rInf ) void SwBlankPortion::Paint( const SwTextPaintInfo &rInf ) const { if( !bMulti ) // No gray background for multiportion brackets - rInf.DrawViewOpt( *this, POR_BLANK ); + rInf.DrawViewOpt( *this, PortionType::Blank ); SwExpandPortion::Paint( rInf ); } @@ -214,7 +214,7 @@ SwPostItsPortion::SwPostItsPortion( bool bScrpt ) : bScript( bScrpt ) { nLineLength = TextFrameIndex(1); - SetWhichPor( POR_POSTITS ); + SetWhichPor( PortionType::PostIts ); } void SwPostItsPortion::Paint( const SwTextPaintInfo &rInf ) const diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx index 3373cdfda8eb..e787ae400e4b 100644 --- a/sw/source/core/text/porexp.hxx +++ b/sw/source/core/text/porexp.hxx @@ -25,7 +25,7 @@ class SwExpandPortion : public SwTextPortion { public: - SwExpandPortion() { SetWhichPor( POR_EXP ); } + SwExpandPortion() { SetWhichPor( PortionType::Expand ); } virtual bool Format( SwTextFormatInfo &rInf ) override; virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override; virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override; @@ -43,7 +43,7 @@ class SwBlankPortion : public SwExpandPortion public: SwBlankPortion( sal_Unicode cCh, bool bMult = false ) : cChar( cCh ), bMulti( bMult ) - { cChar = cCh; SetLen(TextFrameIndex(1)); SetWhichPor( POR_BLANK ); } + { cChar = cCh; SetLen(TextFrameIndex(1)); SetWhichPor( PortionType::Blank ); } virtual SwLinePortion *Compress() override; virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index ff838aeb3e6b..95bba3bbc791 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -82,7 +82,7 @@ SwFieldPortion::SwFieldPortion( const OUString &rExpand, std::unique_ptr , m_bNoLength( false ) , m_nAttrFieldType(0) { - SetWhichPor( POR_FLD ); + SetWhichPor( PortionType::Field ); } SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField ) @@ -106,7 +106,7 @@ SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField ) if ( rField.HasFont() ) m_pFont.reset( new SwFont( *rField.GetFont() ) ); - SetWhichPor( POR_FLD ); + SetWhichPor( PortionType::Field ); } SwFieldPortion::~SwFieldPortion() @@ -432,7 +432,7 @@ void SwFieldPortion::Paint( const SwTextPaintInfo &rInf ) const if( Width() && ( !m_bPlaceHolder || rInf.GetOpt().IsShowPlaceHolderFields() ) ) { // A very liberal use of the background - rInf.DrawViewOpt( *this, POR_FLD ); + rInf.DrawViewOpt( *this, PortionType::Field ); SwExpandPortion::Paint( rInf ); } } @@ -480,7 +480,7 @@ void SwHiddenPortion::Paint( const SwTextPaintInfo &rInf ) const if( Width() ) { SwFontSave aSave( rInf, m_pFont.get() ); - rInf.DrawViewOpt( *this, POR_HIDDEN ); + rInf.DrawViewOpt( *this, PortionType::Hidden ); SwExpandPortion::Paint( rInf ); } } @@ -502,7 +502,7 @@ SwNumberPortion::SwNumberPortion( const OUString &rExpand, nMinDist( nMinDst ), mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive ) { - SetWhichPor( POR_NUMBER ); + SetWhichPor( PortionType::Number ); SetLeft( bLft ); SetHide( false ); SetCenter( bCntr ); @@ -655,7 +655,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const { SwNumberPortion *pThis = const_cast(this); pThis->Width( nSumWidth ); - rInf.DrawViewOpt( *this, POR_NUMBER ); + rInf.DrawViewOpt( *this, PortionType::Number ); pThis->Width( nOldWidth ); } @@ -744,7 +744,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet, std::move(pFont), bLft, bCntr, nMinDst, bLabelAlignmentPosAndSpaceModeActive ) { - SetWhichPor( POR_BULLET ); + SetWhichPor( PortionType::Bullet ); } #define GRFNUM_SECURE 10 @@ -759,7 +759,7 @@ SwGrfNumPortion::SwGrfNumPortion( bLabelAlignmentPosAndSpaceModeActive ), pBrush( new SvxBrushItem(RES_BACKGROUND) ), nId( 0 ) { - SetWhichPor( POR_GRFNUM ); + SetWhichPor( PortionType::GrfNum ); SetAnimated( false ); m_bReplace = false; if( pGrfBrush ) @@ -1063,7 +1063,7 @@ SwCombinedPortion::SwCombinedPortion( const OUString &rText ) , nProportion(55) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_COMBINED ); + SetWhichPor( PortionType::Combined ); if( m_aExpand.getLength() > 6 ) m_aExpand = m_aExpand.copy( 0, 6 ); @@ -1092,7 +1092,7 @@ void SwCombinedPortion::Paint( const SwTextPaintInfo &rInf ) const return; rInf.DrawBackBrush( *this ); - rInf.DrawViewOpt( *this, POR_FLD ); + rInf.DrawViewOpt( *this, PortionType::Field ); // do we have to repaint a post it portion? if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() ) diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index 151404197cd9..4434f1e8c577 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -109,7 +109,7 @@ class SwHiddenPortion : public SwFieldPortion public: SwHiddenPortion( const OUString &rExpand, std::unique_ptr pFntL = nullptr ) : SwFieldPortion( rExpand, std::move(pFntL) ) - { SetLen(TextFrameIndex(1)); SetWhichPor( POR_HIDDEN ); } + { SetLen(TextFrameIndex(1)); SetWhichPor( PortionType::Hidden ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override; diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 8d4fe773d1d2..7c23bb17cae7 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -256,7 +256,7 @@ SwFlyCntPortion::SwFlyCntPortion() , m_eAlign(sw::LineAlign::NONE) { nLineLength = TextFrameIndex(1); - SetWhichPor(POR_FLYCNT); + SetWhichPor(PortionType::FlyCnt); } sw::FlyContentPortion::FlyContentPortion(SwFlyInContentFrame* pFly) diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx index a38592a1be1e..e2c03600f770 100644 --- a/sw/source/core/text/porfly.hxx +++ b/sw/source/core/text/porfly.hxx @@ -34,7 +34,7 @@ class SwFlyPortion : public SwFixPortion sal_uInt16 nBlankWidth; public: explicit SwFlyPortion( const SwRect &rFlyRect ) - : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); } + : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( PortionType::Fly ); } sal_uInt16 GetBlankWidth( ) const { return nBlankWidth; } void SetBlankWidth( const sal_uInt16 nNew ) { nBlankWidth = nNew; } virtual void Paint( const SwTextPaintInfo &rInf ) const override; diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx index 97b5275ed696..087687588010 100644 --- a/sw/source/core/text/porftn.hxx +++ b/sw/source/core/text/porftn.hxx @@ -52,7 +52,7 @@ class SwFootnoteNumPortion : public SwNumberPortion public: SwFootnoteNumPortion( const OUString &rExpand, std::unique_ptr pFntL ) : SwNumberPortion( rExpand, std::move(pFntL), true, false, 0, false ) - { SetWhichPor( POR_FTNNUM ); } + { SetWhichPor( PortionType::FootnoteNum ); } }; class SwQuoVadisPortion : public SwFieldPortion diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index 30a525657540..d35a5be48ef8 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -31,7 +31,7 @@ SwGluePortion::SwGluePortion( const sal_uInt16 nInitFixWidth ) : nFixWidth( nInitFixWidth ) { PrtWidth( nFixWidth ); - SetWhichPor( POR_GLUE ); + SetWhichPor( PortionType::Glue ); } TextFrameIndex SwGluePortion::GetCursorOfst(const sal_uInt16 nOfst) const @@ -137,19 +137,19 @@ SwFixPortion::SwFixPortion( const SwRect &rRect ) :SwGluePortion( sal_uInt16(rRect.Width()) ), nFix( sal_uInt16(rRect.Left()) ) { Height( sal_uInt16(rRect.Height()) ); - SetWhichPor( POR_FIX ); + SetWhichPor( PortionType::Fix ); } SwFixPortion::SwFixPortion() : SwGluePortion(0), nFix(0) { - SetWhichPor( POR_FIX ); + SetWhichPor( PortionType::Fix ); } SwMarginPortion::SwMarginPortion() :SwGluePortion( 0 ) { - SetWhichPor( POR_MARGIN ); + SetWhichPor( PortionType::Margin ); } /** diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx index b00bddc1cf5d..3ed5cf12da9f 100644 --- a/sw/source/core/text/porhyph.hxx +++ b/sw/source/core/text/porhyph.hxx @@ -26,7 +26,7 @@ class SwHyphPortion : public SwExpandPortion public: SwHyphPortion() { - SetWhichPor( POR_HYPH ); + SetWhichPor( PortionType::Hyphen ); } virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override; virtual bool Format( SwTextFormatInfo &rInf ) override; @@ -42,7 +42,7 @@ public: explicit SwHyphStrPortion(const OUString &rStr) : aExpand(rStr + "-") { - SetWhichPor( POR_HYPHSTR ); + SetWhichPor( PortionType::HyphenStr ); } virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 7b646331e9b3..26ecefa20d5b 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -375,7 +375,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) // portion spanning to the end or the next fixed portion while( pPos ) { - SAL_WARN_IF( POR_LIN == pPos->GetWhichPor(), + SAL_WARN_IF( PortionType::NONE == pPos->GetWhichPor(), "sw.core", "SwLineLayout::CalcLine: don't use SwLinePortions !" ); // Null portions are eliminated. They can form if two FlyFrames @@ -482,7 +482,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf ) if( Height() < nPosHeight ) { // Height is set to 0 when Init() is called. - if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->GetWhichPor() == POR_FLYCNT) + if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->GetWhichPor() == PortionType::FlyCnt) // Compat flag set: take the line height, if it's larger. Height(std::max(nPosHeight, nLineHeight)); else @@ -665,7 +665,7 @@ SwLineLayout::SwLineLayout() m_bUnderscore( false ) { ResetFlags(); - SetWhichPor( POR_LAY ); + SetWhichPor( PortionType::Lay ); } SwLinePortion *SwLineLayout::GetFirstPortion() const @@ -2151,7 +2151,7 @@ SwParaPortion::SwParaPortion() { FormatReset(); m_bFlys = m_bFootnoteNum = m_bMargin = false; - SetWhichPor( POR_PARA ); + SetWhichPor( PortionType::Para ); } SwParaPortion::~SwParaPortion() diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx index 5cb568f89641..4dc4b671e966 100644 --- a/sw/source/core/text/porlin.cxx +++ b/sw/source/core/text/porlin.cxx @@ -72,7 +72,7 @@ SwLinePortion::SwLinePortion( ) : mpNextPortion( nullptr ), nLineLength( 0 ), nAscent( 0 ), - nWhichPor( POR_LIN ), + nWhichPor( PortionType::NONE ), m_bJoinBorderWithPrev(false), m_bJoinBorderWithNext(false) { diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx index 661eaf7b0534..2b45e7561e5a 100644 --- a/sw/source/core/text/porlin.hxx +++ b/sw/source/core/text/porlin.hxx @@ -60,7 +60,7 @@ protected: SwLinePortion(); private: - sal_uInt16 nWhichPor; // Who's who? + PortionType nWhichPor; // Who's who? bool m_bJoinBorderWithPrev; bool m_bJoinBorderWithNext; @@ -93,49 +93,49 @@ public: // Returns 0, if there's no payload virtual SwLinePortion *Compress(); - void SetWhichPor( const sal_uInt16 nNew ) { nWhichPor = nNew; } - sal_uInt16 GetWhichPor( ) const { return nWhichPor; } + void SetWhichPor( const PortionType nNew ) { nWhichPor = nNew; } + PortionType GetWhichPor( ) const { return nWhichPor; } // Group queries - bool InTextGrp() const { return (nWhichPor & PORGRP_TXT) != 0; } - bool InGlueGrp() const { return (nWhichPor & PORGRP_GLUE) != 0; } - bool InTabGrp() const { return (nWhichPor & PORGRP_TAB) != 0; } - bool InHyphGrp() const { return (nWhichPor & PORGRP_HYPH) != 0; } - bool InNumberGrp() const { return (nWhichPor & PORGRP_NUMBER) != 0; } - bool InFixGrp() const { return (nWhichPor & PORGRP_FIX) != 0; } - bool InFieldGrp() const { return (nWhichPor & PORGRP_FLD) != 0; } - bool InToxRefGrp() const { return (nWhichPor & PORGRP_TOXREF) != 0; } - bool InToxRefOrFieldGrp() const { return (nWhichPor & ( PORGRP_FLD | PORGRP_TOXREF )) != 0; } - bool InExpGrp() const { return (nWhichPor & PORGRP_EXP) != 0; } - bool InFixMargGrp() const { return (nWhichPor & PORGRP_FIXMARG) != 0; } + bool InTextGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TXT) != 0; } + bool InGlueGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_GLUE) != 0; } + bool InTabGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TAB) != 0; } + bool InHyphGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_HYPH) != 0; } + bool InNumberGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_NUMBER) != 0; } + bool InFixGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FIX) != 0; } + bool InFieldGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FLD) != 0; } + bool InToxRefGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TOXREF) != 0; } + bool InToxRefOrFieldGrp() const { return (sal_uInt16(nWhichPor) & ( PORGRP_FLD | PORGRP_TOXREF )) != 0; } + bool InExpGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_EXP) != 0; } + bool InFixMargGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FIXMARG) != 0; } bool InSpaceGrp() const { return InTextGrp() || IsMultiPortion(); } // Individual queries - bool IsGrfNumPortion() const { return nWhichPor == POR_GRFNUM; } - bool IsFlyCntPortion() const { return nWhichPor == POR_FLYCNT; } - bool IsBlankPortion() const { return nWhichPor == POR_BLANK; } - bool IsBreakPortion() const { return nWhichPor == POR_BRK; } - bool IsErgoSumPortion() const { return nWhichPor == POR_ERGOSUM; } - bool IsQuoVadisPortion() const { return nWhichPor == POR_QUOVADIS; } - bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; } - bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; } - bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; } - bool IsFootnotePortion() const { return nWhichPor == POR_FTN; } - bool IsDropPortion() const { return nWhichPor == POR_DROP; } - bool IsLayPortion() const { return nWhichPor == POR_LAY; } - bool IsParaPortion() const { return nWhichPor == POR_PARA; } - bool IsMarginPortion() const { return nWhichPor == POR_MARGIN; } - bool IsFlyPortion() const { return nWhichPor == POR_FLY; } - bool IsHolePortion() const { return nWhichPor == POR_HOLE; } - bool IsSoftHyphPortion() const { return nWhichPor == POR_SOFTHYPH; } - bool IsPostItsPortion() const { return nWhichPor == POR_POSTITS; } - bool IsCombinedPortion() const { return nWhichPor == POR_COMBINED; } - bool IsTextPortion() const { return nWhichPor == POR_TXT; } - bool IsHangingPortion() const { return nWhichPor == POR_HNG; } - bool IsKernPortion() const { return nWhichPor == POR_KERN; } - bool IsArrowPortion() const { return nWhichPor == POR_ARROW; } - bool IsMultiPortion() const { return nWhichPor == POR_MULTI; } - bool IsNumberPortion() const { return nWhichPor == POR_NUMBER; } // #i23726# - bool IsControlCharPortion() const { return nWhichPor == POR_CONTROLCHAR; } + bool IsGrfNumPortion() const { return nWhichPor == PortionType::GrfNum; } + bool IsFlyCntPortion() const { return nWhichPor == PortionType::FlyCnt; } + bool IsBlankPortion() const { return nWhichPor == PortionType::Blank; } + bool IsBreakPortion() const { return nWhichPor == PortionType::Break; } + bool IsErgoSumPortion() const { return nWhichPor == PortionType::ErgoSum; } + bool IsQuoVadisPortion() const { return nWhichPor == PortionType::QuoVadis; } + bool IsTabLeftPortion() const { return nWhichPor == PortionType::TabLeft; } + bool IsTabRightPortion() const { return nWhichPor == PortionType::TabRight; } + bool IsFootnoteNumPortion() const { return nWhichPor == PortionType::FootnoteNum; } + bool IsFootnotePortion() const { return nWhichPor == PortionType::Footnote; } + bool IsDropPortion() const { return nWhichPor == PortionType::Drop; } + bool IsLayPortion() const { return nWhichPor == PortionType::Lay; } + bool IsParaPortion() const { return nWhichPor == PortionType::Para; } + bool IsMarginPortion() const { return nWhichPor == PortionType::Margin; } + bool IsFlyPortion() const { return nWhichPor == PortionType::Fly; } + bool IsHolePortion() const { return nWhichPor == PortionType::Hole; } + bool IsSoftHyphPortion() const { return nWhichPor == PortionType::SoftHyphen; } + bool IsPostItsPortion() const { return nWhichPor == PortionType::PostIts; } + bool IsCombinedPortion() const { return nWhichPor == PortionType::Combined; } + bool IsTextPortion() const { return nWhichPor == PortionType::Text; } + bool IsHangingPortion() const { return nWhichPor == PortionType::Hanging; } + bool IsKernPortion() const { return nWhichPor == PortionType::Kern; } + bool IsArrowPortion() const { return nWhichPor == PortionType::Arrow; } + bool IsMultiPortion() const { return nWhichPor == PortionType::Multi; } + bool IsNumberPortion() const { return nWhichPor == PortionType::Number; } // #i23726# + bool IsControlCharPortion() const { return nWhichPor == PortionType::ControlChar; } // Positioning SwLinePortion *FindPrevPortion( const SwLinePortion *pRoot ); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index a5b349e20e98..af73cf028aad 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1536,7 +1536,7 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint, #if OSL_DEBUG_LEVEL > 1 // only paint first level bidi portions if( rMulti.Width() > 1 && ! pEnvPor ) - GetInfo().DrawViewOpt( rMulti, POR_FLD ); + GetInfo().DrawViewOpt( rMulti, PortionType::Field ); #endif if ( bRubyInGrid && pGrid->IsSquaredMode() ) diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx index 1456136379e8..bb6b9f33d43f 100644 --- a/sw/source/core/text/pormulti.hxx +++ b/sw/source/core/text/pormulti.hxx @@ -106,7 +106,7 @@ protected: , eRubyPosition( RubyPosition::ABOVE ) , nDirection(0) { - SetWhichPor(POR_MULTI); + SetWhichPor(PortionType::Multi); SetLen(nEnd); } void SetDouble() { bDouble = true; } diff --git a/sw/source/core/text/porref.cxx b/sw/source/core/text/porref.cxx index a0c8156cee61..9ddb232d1417 100644 --- a/sw/source/core/text/porref.cxx +++ b/sw/source/core/text/porref.cxx @@ -27,7 +27,7 @@ void SwRefPortion::Paint( const SwTextPaintInfo &rInf ) const { if( Width() ) { - rInf.DrawViewOpt( *this, POR_REF ); + rInf.DrawViewOpt( *this, PortionType::Ref ); SwTextPortion::Paint( rInf ); } } @@ -37,7 +37,7 @@ SwLinePortion *SwIsoRefPortion::Compress() { return this; } SwIsoRefPortion::SwIsoRefPortion() : nViewWidth(0) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_ISOREF ); + SetWhichPor( PortionType::IsoRef ); } sal_uInt16 SwIsoRefPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const @@ -64,7 +64,7 @@ bool SwIsoRefPortion::Format( SwTextFormatInfo &rInf ) void SwIsoRefPortion::Paint( const SwTextPaintInfo &rInf ) const { if( Width() ) - rInf.DrawViewOpt( *this, POR_REF ); + rInf.DrawViewOpt( *this, PortionType::Ref ); } void SwIsoRefPortion::HandlePortion( SwPortionHandler& rPH ) const diff --git a/sw/source/core/text/porref.hxx b/sw/source/core/text/porref.hxx index 7d5963a24de5..0c7dc85037b9 100644 --- a/sw/source/core/text/porref.hxx +++ b/sw/source/core/text/porref.hxx @@ -24,7 +24,7 @@ class SwRefPortion : public SwTextPortion { public: - SwRefPortion(){ SetWhichPor( POR_REF ); } + SwRefPortion(){ SetWhichPor( PortionType::Ref ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; }; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index c00393358385..1f70727abd51 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -53,7 +53,7 @@ SwTmpEndPortion::SwTmpEndPortion( const SwLinePortion &rPortion ) { Height( rPortion.Height() ); SetAscent( rPortion.GetAscent() ); - SetWhichPor( POR_TMPEND ); + SetWhichPor( PortionType::TempEnd ); } void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const @@ -77,7 +77,7 @@ SwBreakPortion::SwBreakPortion( const SwLinePortion &rPortion ) : SwLinePortion( rPortion ) { nLineLength = TextFrameIndex(1); - SetWhichPor( POR_BRK ); + SetWhichPor( PortionType::Break ); } TextFrameIndex SwBreakPortion::GetCursorOfst(const sal_uInt16) const @@ -120,7 +120,7 @@ SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn, Height( rPortion.Height() ); SetAscent( rPortion.GetAscent() ); nLineLength = TextFrameIndex(0); - SetWhichPor( POR_KERN ); + SetWhichPor( PortionType::Kern ); if( nKern > 0 ) Width( nKern ); rPortion.Insert( this ); @@ -133,7 +133,7 @@ SwKernPortion::SwKernPortion( const SwLinePortion& rPortion ) : SetAscent( rPortion.GetAscent() ); nLineLength = TextFrameIndex(0); - SetWhichPor( POR_KERN ); + SetWhichPor( PortionType::Kern ); } void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const @@ -142,7 +142,7 @@ void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const { // bBackground is set for Kerning Portions between two fields if ( bBackground ) - rInf.DrawViewOpt( *this, POR_FLD ); + rInf.DrawViewOpt( *this, PortionType::Field ); rInf.DrawBackBrush( *this ); if (GetJoinBorderWithNext() ||GetJoinBorderWithPrev()) @@ -183,7 +183,7 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) : Height( rPortion.Height() ); SetAscent( rPortion.GetAscent() ); nLineLength = TextFrameIndex(0); - SetWhichPor( POR_ARROW ); + SetWhichPor( PortionType::Arrow ); } SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf ) @@ -194,7 +194,7 @@ SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf ) rInf.GetTextFrame()->getFramePrintArea().Right() ); aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() + rInf.GetTextFrame()->getFramePrintArea().Bottom() ); - SetWhichPor( POR_ARROW ); + SetWhichPor( PortionType::Arrow ); } void SwArrowPortion::Paint( const SwTextPaintInfo &rInf ) const @@ -487,7 +487,7 @@ void SwControlCharPortion::Paint( const SwTextPaintInfo &rInf ) const { if ( Width() ) // is only set during prepaint mode { - rInf.DrawViewOpt( *this, POR_CONTROLCHAR ); + rInf.DrawViewOpt( *this, PortionType::ControlChar ); if ( !rInf.GetOpt().IsPagePreview() && !rInf.GetOpt().IsReadonly() && diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx index f90e7abdf5f6..a7ae25dd4076 100644 --- a/sw/source/core/text/porrst.hxx +++ b/sw/source/core/text/porrst.hxx @@ -95,7 +95,7 @@ class SwHangingPortion : public SwTextPortion public: explicit SwHangingPortion( SwPosSize aSize ) : nInnerWidth( aSize.Width() ) { - SetWhichPor( POR_HNG ); + SetWhichPor( PortionType::Hanging ); SetLen(TextFrameIndex(1)); Height( aSize.Height() ); } @@ -109,7 +109,7 @@ class SwHiddenTextPortion : public SwLinePortion public: explicit SwHiddenTextPortion(TextFrameIndex const nLen) { - SetWhichPor( POR_HIDDEN_TXT ); SetLen( nLen ); + SetWhichPor( PortionType::HiddenText ); SetLen( nLen ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; @@ -129,7 +129,7 @@ public: explicit SwControlCharPortion( sal_Unicode cChar ) : mnViewWidth( 0 ), mnHalfCharWidth( 0 ), mcChar( cChar ) { - SetWhichPor( POR_CONTROLCHAR ); SetLen( TextFrameIndex(1) ); + SetWhichPor( PortionType::ControlChar ); SetLen( TextFrameIndex(1) ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx index e03858f14915..3c6e7a5df137 100644 --- a/sw/source/core/text/portab.hxx +++ b/sw/source/core/text/portab.hxx @@ -47,7 +47,7 @@ class SwTabLeftPortion : public SwTabPortion public: SwTabLeftPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar, bool bAutoTab ) : SwTabPortion( nTabPosVal, cFillChar, bAutoTab ) - { SetWhichPor( POR_TABLEFT ); } + { SetWhichPor( PortionType::TabLeft ); } }; class SwTabRightPortion : public SwTabPortion @@ -55,7 +55,7 @@ class SwTabRightPortion : public SwTabPortion public: SwTabRightPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar ) : SwTabPortion( nTabPosVal, cFillChar ) - { SetWhichPor( POR_TABRIGHT ); } + { SetWhichPor( PortionType::TabRight ); } }; class SwTabCenterPortion : public SwTabPortion @@ -63,7 +63,7 @@ class SwTabCenterPortion : public SwTabPortion public: SwTabCenterPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar ) : SwTabPortion( nTabPosVal, cFillChar ) - { SetWhichPor( POR_TABCENTER ); } + { SetWhichPor( PortionType::TabCenter ); } }; class SwTabDecimalPortion : public SwTabPortion @@ -83,7 +83,7 @@ public: : SwTabPortion( nTabPosVal, cFillChar ), mcTab(cTab), mnWidthOfPortionsUpTpDecimalPosition( USHRT_MAX ) - { SetWhichPor( POR_TABDECIMAL ); } + { SetWhichPor( PortionType::TabDecimal ); } sal_Unicode GetTabDecimal() const { return mcTab; } diff --git a/sw/source/core/text/portox.cxx b/sw/source/core/text/portox.cxx index ba28c0bc8003..a746058e9b07 100644 --- a/sw/source/core/text/portox.cxx +++ b/sw/source/core/text/portox.cxx @@ -27,7 +27,7 @@ void SwToxPortion::Paint( const SwTextPaintInfo &rInf ) const { if( Width() ) { - rInf.DrawViewOpt( *this, POR_TOX ); + rInf.DrawViewOpt( *this, PortionType::Tox ); SwTextPortion::Paint( rInf ); } } @@ -37,7 +37,7 @@ SwLinePortion *SwIsoToxPortion::Compress() { return this; } SwIsoToxPortion::SwIsoToxPortion() : nViewWidth(0) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_ISOTOX ); + SetWhichPor( PortionType::IsoTox ); } sal_uInt16 SwIsoToxPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const @@ -66,7 +66,7 @@ bool SwIsoToxPortion::Format( SwTextFormatInfo &rInf ) void SwIsoToxPortion::Paint( const SwTextPaintInfo &rInf ) const { if( Width() ) - rInf.DrawViewOpt( *this, POR_TOX ); + rInf.DrawViewOpt( *this, PortionType::Tox ); } void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const diff --git a/sw/source/core/text/portox.hxx b/sw/source/core/text/portox.hxx index f854b1adc4e1..b2c8f23a76df 100644 --- a/sw/source/core/text/portox.hxx +++ b/sw/source/core/text/portox.hxx @@ -25,7 +25,7 @@ class SwToxPortion : public SwTextPortion { public: - SwToxPortion(){ SetWhichPor( POR_TOX ); } + SwToxPortion(){ SetWhichPor( PortionType::Tox ); } virtual void Paint( const SwTextPaintInfo &rInf ) const override; }; diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index b1b0b317e77d..eb3937d10702 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -217,7 +217,7 @@ SwTextPortion * SwTextPortion::CopyLinePortion(const SwLinePortion &rPortion) { SwTextPortion *const pNew(new SwTextPortion); static_cast(*pNew) = rPortion; - pNew->SetWhichPor( POR_TXT ); // overwrite that! + pNew->SetWhichPor( PortionType::Text ); // overwrite that! return pNew; } @@ -677,7 +677,7 @@ void SwTextPortion::HandlePortion( SwPortionHandler& rPH ) const SwTextInputFieldPortion::SwTextInputFieldPortion() : SwTextPortion() { - SetWhichPor( POR_INPUTFLD ); + SetWhichPor( PortionType::InputField ); } bool SwTextInputFieldPortion::Format(SwTextFormatInfo &rTextFormatInfo) @@ -689,7 +689,7 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo &rInf ) const { if ( Width() ) { - rInf.DrawViewOpt( *this, POR_INPUTFLD ); + rInf.DrawViewOpt( *this, PortionType::InputField ); SwTextSlot aPaintText( &rInf, this, true, true, OUString() ); SwTextPortion::Paint( rInf ); } @@ -730,7 +730,7 @@ SwHolePortion::SwHolePortion( const SwTextPortion &rPor ) SetLen( TextFrameIndex(1) ); Height( rPor.Height() ); SetAscent( rPor.GetAscent() ); - SetWhichPor( POR_HOLE ); + SetWhichPor( PortionType::Hole ); } SwLinePortion *SwHolePortion::Compress() { return this; } diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx index cfa0c190afe9..8bf0a0d46bf7 100644 --- a/sw/source/core/text/portxt.hxx +++ b/sw/source/core/text/portxt.hxx @@ -31,7 +31,7 @@ class SwTextPortion : public SwLinePortion bool Format_( SwTextFormatInfo &rInf ); public: - SwTextPortion(){ SetWhichPor( POR_TXT ); } + SwTextPortion(){ SetWhichPor( PortionType::Text ); } static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion); virtual void Paint( const SwTextPaintInfo &rInf ) const override; virtual bool Format( SwTextFormatInfo &rInf ) override; diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index b6250bee6469..65bdc2dd0e5a 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -110,7 +110,7 @@ SwDropPortion::SwDropPortion( const sal_uInt16 nLineCnt, nFix(0), nY(0) { - SetWhichPor( POR_DROP ); + SetWhichPor( PortionType::Drop ); } SwDropPortion::~SwDropPortion() diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 2682ee021493..c9bc349b06d0 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -1309,7 +1309,7 @@ SwFootnotePortion::SwFootnotePortion( const OUString &rExpand, , mnPreferredScriptType( SwFontScript::Latin ) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_FTN ); + SetWhichPor( PortionType::Footnote ); } bool SwFootnotePortion::GetExpText( const SwTextSizeInfo &, OUString &rText ) const @@ -1342,7 +1342,7 @@ void SwFootnotePortion::Paint( const SwTextPaintInfo &rInf ) const // #i98418# // SwFootnoteSave aFootnoteSave( rInf, pFootnote ); SwFootnoteSave aFootnoteSave( rInf, pFootnote, mbPreferredScriptTypeSet, mnPreferredScriptType ); - rInf.DrawViewOpt( *this, POR_FTN ); + rInf.DrawViewOpt( *this, PortionType::Footnote ); SwExpandPortion::Paint( rInf ); } @@ -1370,7 +1370,7 @@ SwQuoVadisPortion::SwQuoVadisPortion( const OUString &rExp, const OUString& rStr : SwFieldPortion( rExp ), aErgo(rStr) { SetLen(TextFrameIndex(0)); - SetWhichPor( POR_QUOVADIS ); + SetWhichPor( PortionType::QuoVadis ); } bool SwQuoVadisPortion::Format( SwTextFormatInfo &rInf ) @@ -1421,7 +1421,7 @@ void SwQuoVadisPortion::Paint( const SwTextPaintInfo &rInf ) const // can quickly switch if( PrtWidth() ) { - rInf.DrawViewOpt( *this, POR_QUOVADIS ); + rInf.DrawViewOpt( *this, PortionType::QuoVadis ); SwTextSlot aDiffText( &rInf, this, true, false ); SwFontSave aSave( rInf, m_pFont.get() ); rInf.DrawText( *this, rInf.GetLen(), true ); @@ -1441,7 +1441,7 @@ SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, const OUString& rStr) // One blank distance to the text m_aExpand += " "; - SetWhichPor( POR_ERGOSUM ); + SetWhichPor( PortionType::ErgoSum ); } TextFrameIndex SwErgoSumPortion::GetCursorOfst(const sal_uInt16) const diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 887f1e154cca..eb6e4d40b8ef 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -92,8 +92,8 @@ bool SwTextFrame::Hyphenate(SwInterHyphInfoTextFrame & rHyphInf) SwLinePortion *pPor = aLine.GetCurr()->GetFirstPortion(); while( pPor->GetNextPortion() ) pPor = pPor->GetNextPortion(); - if( pPor->GetWhichPor() == POR_SOFTHYPH || - pPor->GetWhichPor() == POR_SOFTHYPHSTR ) + if( pPor->GetWhichPor() == PortionType::SoftHyphen || + pPor->GetWhichPor() == PortionType::SoftHyphenStr ) aLine.Next(); } @@ -394,7 +394,7 @@ SwSoftHyphPortion::SwSoftHyphPortion() : bExpand(false), nViewWidth(0) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_SOFTHYPH ); + SetWhichPor( PortionType::SoftHyphen ); } sal_uInt16 SwSoftHyphPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const @@ -426,7 +426,7 @@ void SwSoftHyphPortion::Paint( const SwTextPaintInfo &rInf ) const { if( Width() ) { - rInf.DrawViewOpt( *this, POR_SOFTHYPH ); + rInf.DrawViewOpt( *this, PortionType::SoftHyphen ); SwExpandPortion::Paint( rInf ); } } @@ -550,8 +550,8 @@ bool SwSoftHyphPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const { - const sal_uInt16 nWhich = ! Width() ? - POR_SOFTHYPH_COMP : + const PortionType nWhich = ! Width() ? + PortionType::SoftHyphenComp : GetWhichPor(); rPH.Special( GetLen(), OUString('-'), nWhich ); } @@ -560,7 +560,7 @@ void SwSoftHyphStrPortion::Paint( const SwTextPaintInfo &rInf ) const { // Bug or feature?: // {Zu}{k-}{ker}, {k-} will be gray instead of {-} - rInf.DrawViewOpt( *this, POR_SOFTHYPH ); + rInf.DrawViewOpt( *this, PortionType::SoftHyphen ); SwHyphStrPortion::Paint( rInf ); } @@ -568,7 +568,7 @@ SwSoftHyphStrPortion::SwSoftHyphStrPortion( const OUString &rStr ) : SwHyphStrPortion( rStr ) { SetLen(TextFrameIndex(1)); - SetWhichPor( POR_SOFTHYPHSTR ); + SetWhichPor( PortionType::SoftHyphenStr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 488c60076da7..c2fded221827 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -297,7 +297,7 @@ SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFi { nLineLength = TextFrameIndex(1); OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!"); - SetWhichPor( POR_TAB ); + SetWhichPor( PortionType::Table ); } bool SwTabPortion::Format( SwTextFormatInfo &rInf ) @@ -363,20 +363,20 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf ) if( ! bFull && 0 == nDir ) { - const sal_uInt16 nWhich = GetWhichPor(); + const PortionType nWhich = GetWhichPor(); switch( nWhich ) { - case POR_TABRIGHT: - case POR_TABDECIMAL: - case POR_TABCENTER: + case PortionType::TabRight: + case PortionType::TabDecimal: + case PortionType::TabCenter: { - if( POR_TABDECIMAL == nWhich ) + if( PortionType::TabDecimal == nWhich ) rInf.SetTabDecimal( static_cast(this)->GetTabDecimal()); rInf.SetLastTab( this ); break; } - case POR_TABLEFT: + case PortionType::TabLeft: { // handle this case in PostFormat if( bTabOverMargin && !bAutoTabStop && GetTabPos() > rInf.Width() ) @@ -452,16 +452,16 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf ) pPor = pPor->GetNextPortion(); } - const sal_uInt16 nWhich = GetWhichPor(); + const PortionType nWhich = GetWhichPor(); const bool bTabCompat = rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT); - if ( bTabOverMargin && POR_TABLEFT == nWhich ) + if ( bTabOverMargin && PortionType::TabLeft == nWhich ) { nPorWidth = 0; } // #127428# Abandon dec. tab position if line is full - if ( bTabCompat && POR_TABDECIMAL == nWhich ) + if ( bTabCompat && PortionType::TabDecimal == nWhich ) { sal_uInt16 nPrePorWidth = static_cast(this)->GetWidthOfPortionsUpToDecimalPosition(); @@ -477,7 +477,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf ) } } - if( POR_TABCENTER == nWhich ) + if( PortionType::TabCenter == nWhich ) { // centered tabs are problematic: // We have to detect how much fits into the line. @@ -503,7 +503,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf ) SetFixWidth( PrtWidth() ); // reset last values rInf.SetLastTab(nullptr); - if( POR_TABDECIMAL == nWhich ) + if( PortionType::TabDecimal == nWhich ) rInf.SetTabDecimal(0); return rInf.Width() <= rInf.X(); @@ -546,7 +546,7 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const { // filled tabs are shaded in gray if( IsFilled() ) - rInf.DrawViewOpt( *this, POR_TAB ); + rInf.DrawViewOpt( *this, PortionType::Table ); else rInf.DrawTab( *this ); } diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index b17078e195d7..9a916c87f583 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -35,71 +35,71 @@ class XmlPortionDumper:public SwPortionHandler const OUString& m_rText; OUString m_aLine; - static const char* getTypeName( sal_uInt16 nType ) + static const char* getTypeName( PortionType nType ) { switch ( nType ) { - case POR_LIN: return "POR_LIN"; - case POR_FLYCNT: return "POR_FLYCNT"; - - case POR_HOLE: return "POR_HOLE"; - case POR_TMPEND: return "POR_TMPEND"; - case POR_BRK: return "POR_BRK"; - case POR_KERN: return "POR_KERN"; - case POR_ARROW: return "POR_ARROW"; - case POR_MULTI: return "POR_MULTI"; - case POR_HIDDEN_TXT: return "POR_HIDDEN_TXT"; - case POR_CONTROLCHAR: return "POR_CONTROLCHAR"; - - case POR_TXT: return "POR_TXT"; - case POR_LAY: return "POR_LAY"; - case POR_PARA: return "POR_PARA"; - case POR_URL: return "POR_URL"; - case POR_HNG: return "POR_HNG"; - - case POR_DROP: return "POR_DROP"; - case POR_TOX: return "POR_TOX"; - case POR_ISOTOX: return "POR_ISOTOX"; - case POR_REF: return "POR_REF"; - case POR_ISOREF: return "POR_ISOREF"; - case POR_META: return "POR_META"; - - case POR_EXP: return "POR_EXP"; - case POR_BLANK: return "POR_BLANK"; - case POR_POSTITS: return "POR_POSTITS"; - - case POR_HYPH: return "POR_HYPH"; - case POR_HYPHSTR: return "POR_HYPHSTR"; - case POR_SOFTHYPH: return "POR_SOFTHYPH"; - case POR_SOFTHYPHSTR: return "POR_SOFTHYPHSTR"; - case POR_SOFTHYPH_COMP: return "POR_SOFTHYPH_COMP"; - - case POR_FLD: return "POR_FLD"; - case POR_HIDDEN: return "POR_HIDDEN"; - case POR_QUOVADIS: return "POR_QUOVADIS"; - case POR_ERGOSUM: return "POR_ERGOSUM"; - case POR_COMBINED: return "POR_COMBINED"; - case POR_FTN: return "POR_FTN"; - - case POR_FTNNUM: return "POR_FTNNUM"; - case POR_NUMBER: return "POR_NUMBER"; - case POR_BULLET: return "POR_BULLET"; - case POR_GRFNUM: return "POR_GRFNUM"; - - case POR_GLUE: return "POR_GLUE"; - - case POR_MARGIN: return "POR_MARGIN"; - - case POR_FIX: return "POR_FIX"; - case POR_FLY: return "POR_FLY"; - - case POR_TAB: return "POR_TAB"; - - case POR_TABRIGHT: return "POR_TABRIGHT"; - case POR_TABCENTER: return "POR_TABCENTER"; - case POR_TABDECIMAL: return "POR_TABDECIMAL"; - - case POR_TABLEFT: return "POR_TABLEFT"; + case PortionType::NONE: return "PortionType::NONE"; + case PortionType::FlyCnt: return "PortionType::FlyCnt"; + + case PortionType::Hole: return "PortionType::Hole"; + case PortionType::TempEnd: return "PortionType::TempEnd"; + case PortionType::Break: return "PortionType::Break"; + case PortionType::Kern: return "PortionType::Kern"; + case PortionType::Arrow: return "PortionType::Arrow"; + case PortionType::Multi: return "PortionType::Multi"; + case PortionType::HiddenText: return "PortionType::HiddenText"; + case PortionType::ControlChar: return "PortionType::ControlChar"; + + case PortionType::Text: return "PortionType::Text"; + case PortionType::Lay: return "PortionType::Lay"; + case PortionType::Para: return "PortionType::Para"; + case PortionType::Url: return "PortionType::Url"; + case PortionType::Hanging: return "PortionType::Hanging"; + + case PortionType::Drop: return "PortionType::Drop"; + case PortionType::Tox: return "PortionType::Tox"; + case PortionType::IsoTox: return "PortionType::IsoTox"; + case PortionType::Ref: return "PortionType::Ref"; + case PortionType::IsoRef: return "PortionType::IsoRef"; + case PortionType::Meta: return "PortionType::Meta"; + + case PortionType::Expand: return "PortionType::Expand"; + case PortionType::Blank: return "PortionType::Blank"; + case PortionType::PostIts: return "PortionType::PostIts"; + + case PortionType::Hyphen: return "PortionType::Hyphen"; + case PortionType::HyphenStr: return "PortionType::HyphenStr"; + case PortionType::SoftHyphen: return "PortionType::SoftHyphen"; + case PortionType::SoftHyphenStr: return "PortionType::SoftHyphenStr"; + case PortionType::SoftHyphenComp: return "PortionType::SoftHyphenComp"; + + case PortionType::Field: return "PortionType::Field"; + case PortionType::Hidden: return "PortionType::Hidden"; + case PortionType::QuoVadis: return "PortionType::QuoVadis"; + case PortionType::ErgoSum: return "PortionType::ErgoSum"; + case PortionType::Combined: return "PortionType::Combined"; + case PortionType::Footnote: return "PortionType::Footnote"; + + case PortionType::FootnoteNum: return "PortionType::FootnoteNum"; + case PortionType::Number: return "PortionType::Number"; + case PortionType::Bullet: return "PortionType::Bullet"; + case PortionType::GrfNum: return "PortionType::GrfNum"; + + case PortionType::Glue: return "PortionType::Glue"; + + case PortionType::Margin: return "PortionType::Margin"; + + case PortionType::Fix: return "PortionType::Fix"; + case PortionType::Fly: return "PortionType::Fly"; + + case PortionType::Table: return "PortionType::Table"; + + case PortionType::TabRight: return "PortionType::TabRight"; + case PortionType::TabCenter: return "PortionType::TabCenter"; + case PortionType::TabDecimal: return "PortionType::TabDecimal"; + + case PortionType::TabLeft: return "PortionType::TabLeft"; default: return "Unknown"; } @@ -118,7 +118,7 @@ class XmlPortionDumper:public SwPortionHandler text which is painted on-screen */ virtual void Text( TextFrameIndex nLength, - sal_uInt16 nType, + PortionType nType, sal_Int32 nHeight, sal_Int32 nWidth) override { @@ -154,7 +154,7 @@ class XmlPortionDumper:public SwPortionHandler */ virtual void Special( TextFrameIndex nLength, const OUString & rText, - sal_uInt16 nType, + PortionType nType, sal_Int32 nHeight, sal_Int32 nWidth, const SwFont* pFont ) override -- cgit v1.2.3