diff options
-rw-r--r-- | i18npool/qa/cppunit/test_breakiterator.cxx | 2 | ||||
-rw-r--r-- | sw/inc/hintids.hxx | 2 | ||||
-rw-r--r-- | sw/qa/core/swdoc-test.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewling.cxx | 9 |
11 files changed, 48 insertions, 31 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 56f117e4aae9..b72deda6ebc3 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -252,7 +252,7 @@ void TestBreakIterator::testWordBoundaries() } } - sal_Unicode aJoinTests[] = { 'X', 0x200C, 0x200D, 0x2060, 0xFEFF, 0xFFF9 }; + sal_Unicode aJoinTests[] = { 'X', 0x200C, 0x200D, 0x2060, 0xFEFF, 0xFFF9, 0xFFFA, 0xFFFB }; for (int mode = i18n::WordType::ANY_WORD; mode <= i18n::WordType::WORD_COUNT; ++mode) { //make sure that in all cases isBeginWord and isEndWord matches getWordBoundary diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 9428072fa53a..9ea4bc4ca16f 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -35,7 +35,7 @@ // For SwTxtHints without end index the following char is added: #define CH_TXTATR_BREAKWORD ((sal_Unicode)0x01) -#define CH_TXTATR_INWORD ((sal_Unicode)0x02) +#define CH_TXTATR_INWORD ((sal_Unicode)0xFFF9) #define CH_TXTATR_TAB ((sal_Unicode)'\t') #define CH_TXTATR_NEWLINE ((sal_Unicode)'\n') #define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04) diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx index 49b0930189c2..8c06e252bdc5 100644 --- a/sw/qa/core/swdoc-test.cxx +++ b/sw/qa/core/swdoc-test.cxx @@ -60,6 +60,7 @@ #include "swtypes.hxx" #include "fmtftn.hxx" #include "fmtrfmrk.hxx" +#include "fmtfld.hxx" SO2_DECL_REF(SwDocShell) SO2_IMPL_REF(SwDocShell) @@ -366,6 +367,25 @@ void SwDocTest::testSwScanner() pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len()); CPPUNIT_ASSERT(aDocStat.nWord == 1); CPPUNIT_ASSERT_MESSAGE("refmark anchor should not be counted", aDocStat.nChar == 11); + + m_pDoc->AppendTxtNode(*aPaM.GetPoint()); + m_pDoc->InsertString(aPaM, rtl::OUString("Apple")); + + DateTime aDate(DateTime::SYSTEM); + SwPostItField aPostIt( + (SwPostItFieldType*)m_pDoc->GetSysFldType(RES_POSTITFLD), rtl::OUString("An Author"), + rtl::OUString("Some Text"), rtl::OUString("WhatEver"), aDate ); + m_pDoc->InsertPoolItem(aPaM, SwFmtFld(aPostIt), 0); + + m_pDoc->InsertString(aPaM, rtl::OUString("Apple")); + pTxtNode = aPaM.GetNode()->GetTxtNode(); + aDocStat.Reset(); + pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len()); + CPPUNIT_ASSERT(aDocStat.nWord == 1); + CPPUNIT_ASSERT_MESSAGE("postit anchor should effectively not exist", aDocStat.nChar == 10); + CPPUNIT_ASSERT(pTxtNode->Len() == 11); + + aDocStat.Reset(); } //See https://bugs.freedesktop.org/show_bug.cgi?id=46757 diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 54d0bb9c16b5..31bd6dadb3ac 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3369,9 +3369,9 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, Pop(sal_False); // make sure the selection build later from the data below does not - // include footnotes and other "in word" character to the left and - // right in order to preserve those. Therefore count those "in - // words" in order to modify the selection accordingly. + // include "in word" character to the left and right in order to + // preserve those. Therefore count those "in words" in order to + // modify the selection accordingly. const sal_Unicode* pChar = aText.GetBuffer(); xub_StrLen nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index a5e6f9fb6b92..ffe27d3c3236 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1049,11 +1049,10 @@ uno::Reference< XSpellAlternatives > xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); - // make sure the selection build later from the - // data below does not include footnotes and other - // "in word" character to the left and right in order - // to preserve those. Therefore count those "in words" - // in order to modify the selection accordingly. + // make sure the selection build later from the data below does + // not "in word" character to the left and right in order to + // preserve those. Therefore count those "in words" in order to + // modify the selection accordingly. const sal_Unicode* pChar = aText.GetBuffer(); xub_StrLen nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) @@ -1179,11 +1178,10 @@ bool SwEditShell::GetGrammarCorrection( xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); - // make sure the selection build later from the - // data below does not include footnotes and other - // "in word" character to the left and right in order - // to preserve those. Therefore count those "in words" - // in order to modify the selection accordingly. + // make sure the selection build later from the data below does + // not include "in word" character to the left and right in + // order to preserve those. Therefore count those "in words" in + // order to modify the selection accordingly. const sal_Unicode* pChar = aText.GetBuffer(); xub_StrLen nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 85336a8e42a6..0f24ecf87ae7 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1377,7 +1377,7 @@ void lcl_CopyHint( const sal_uInt16 nWhich, const SwTxtAttr * const pHt, case RES_TXTATR_META: case RES_TXTATR_METAFIELD: OSL_ENSURE(pNewHt, "copying Meta should not fail!"); - OSL_ENSURE(pDest && (CH_TXTATR_INWORD == + OSL_ENSURE(pDest && (CH_TXTATR_BREAKWORD == pDest->GetTxt().GetChar(*pNewHt->GetStart())), "missing CH_TXTATR?"); break; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index fd419ef9d7f6..a1afcde4cfa0 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -3013,16 +3013,16 @@ sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr ) sal_Unicode cRet = CH_TXTATR_BREAKWORD; switch ( rAttr.Which() ) { - case RES_TXTATR_FTN: case RES_TXTATR_REFMARK: case RES_TXTATR_TOXMARK: - case RES_TXTATR_META: - case RES_TXTATR_METAFIELD: cRet = CH_TXTATR_INWORD; break; case RES_TXTATR_FIELD: case RES_TXTATR_FLYCNT: + case RES_TXTATR_FTN: + case RES_TXTATR_META: + case RES_TXTATR_METAFIELD: { cRet = CH_TXTATR_BREAKWORD; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 26716a7cf79c..7da33e915e77 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -942,11 +942,11 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs) } else { - // make sure the selection build later from the - // data below does not include footnotes and other - // "in word" character to the left and right in order - // to preserve those. Therefore count those "in words" - // in order to modify the selection accordingly. + // make sure the selection build later from the data + // below does not include "in word" character to the + // left and right in order to preserve those. Therefore + // count those "in words" in order to modify the + // selection accordingly. const sal_Unicode* pChar = rWord.GetBuffer(); xub_StrLen nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index a7ca88635a33..8b53d6db4daf 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -3566,7 +3566,7 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) pPam->GetPoint()->nContent--; nPos--; aFtnNote.SetNumStr(rtl::OUString(pTxtNd->GetTxt().GetChar(nPos))); - ((String&)pTxtNd->GetTxt()).SetChar( nPos, CH_TXTATR_INWORD ); + ((String&)pTxtNd->GetTxt()).SetChar( nPos, CH_TXTATR_BREAKWORD ); bDelFirstChar = sal_True; } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 992089013cb5..6acf843cc003 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3159,7 +3159,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) break; case 0x2: // Auto-Footnote-Number, should be replaced by SwWW8ImplReader::End_Ftn later if (!maFtnStack.empty()) - cInsert = CH_TXTATR_INWORD; + cInsert = 0x2; break; #if OSL_DEBUG_LEVEL > 1 default: diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 1722998e6499..ae8c23453035 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -533,11 +533,10 @@ void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rL pWrtShell->SelWrd(); - // make sure the selection build later from the - // data below does not include footnotes and other - // "in word" character to the left and right in order - // to preserve those. Therefore count those "in words" - // in order to modify the selection accordingly. + // make sure the selection build later from the data below does not + // include "in word" character to the left and right in order to + // preserve those. Therefore count those "in words" in order to modify + // the selection accordingly. const sal_Unicode* pChar = rLookUpText.GetBuffer(); xub_StrLen nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) |