From d4900cb837780d770504877ff90b1e4848d91ff3 Mon Sep 17 00:00:00 2001 From: os Date: Mon, 8 Mar 2010 14:01:48 +0100 Subject: #b6919254# sorted insert of AutoText groups --- sw/source/ui/ribbar/workctrl.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx index e74b212fd4..968eb1f7a9 100644 --- a/sw/source/ui/ribbar/workctrl.cxx +++ b/sw/source/ui/ribbar/workctrl.cxx @@ -242,6 +242,18 @@ SwTbxAutoTextCtrl::~SwTbxAutoTextCtrl() /********************************************************************** **********************************************************************/ +void lcl_InsertSorted( PopupMenu& rPopup, const XubString& rTitle, USHORT nItemId ) +{ + USHORT nPosition = 0; + for( USHORT nEntry = 0; nEntry < rPopup.GetItemCount(); ++nEntry ) + { + String sEntry = rPopup.GetItemText( rPopup.GetItemId( nEntry )); + if( COMPARE_LESS == rTitle.CompareIgnoreCaseToAscii( sEntry)) + break; + ++nPosition; + } + rPopup.InsertItem( nItemId, rTitle, 0, nPosition); +} SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow() @@ -285,8 +297,9 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow() if(nBlockCount) { USHORT nIndex = 100 * (i); - // aber ohne extension einfuegen - pPopup->InsertItem( i, sTitle);//sGroupName.GetToken(0, GLOS_DELIM)); + // insert without extension + //b6919254 + lcl_InsertSorted( *pPopup, sTitle, i ); PopupMenu* pSub = new PopupMenu; pSub->SetSelectHdl(aLnk); pPopup->SetPopupMenu(i, pSub); @@ -296,7 +309,7 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow() String sLongName(pGlossaryList->GetBlockName(i - 1, j, sEntry)); sEntry.AppendAscii(" - "); sEntry += sLongName; - pSub->InsertItem(++nIndex, sEntry); + lcl_InsertSorted( *pSub, sEntry, ++nIndex ); } } } -- cgit v1.2.3 From 159521edd21e37d6d83dc9599ca7ca1faa3fa640 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 9 Mar 2010 10:51:18 +0100 Subject: #i109579# - assure consistent Writer core attributes when list styles are deleted via UNO-API --- sw/source/core/SwNumberTree/SwNodeNum.cxx | 19 ++++++++++++++++++- sw/source/core/unocore/unocrsrhelper.cxx | 9 +++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 171c4de920..c13b396e76 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -40,6 +40,10 @@ // --> OD 2007-10-31 #i83479# #include // <-- +// --> OD 2010-01-13 #b6912256# +#include +#include +// <-- // --> OD 2008-02-19 #refactorlists# SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode ) @@ -492,8 +496,21 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) SwTxtNode* pTxtNode( rNodeNum.GetTxtNode() ); if ( pTxtNode ) { - // --> OD 2008-03-13 #refactorlists# pTxtNode->RemoveFromList(); + // --> OD 2010-01-13 #b6912256# + // clear all list attributes and the list style + SvUShortsSort aResetAttrsArray; + aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); + aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); + aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); + aResetAttrsArray.Insert( RES_PARATR_NUMRULE ); + SwPaM aPam( *pTxtNode ); + pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, + &aResetAttrsArray, + false ); + // <-- } } } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 08c22ac8e6..4e7516934f 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -232,12 +232,9 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry case FN_NUMBER_NEWSTART: { const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); - // --> OD 2006-10-19 #134160# - make code robust: - // consider case that PaM doesn't denote a text node - const SwNumRule* pRule = pTxtNd ? pTxtNd->GetNumRule() : 0; + // --> OD 2010-01-13 #b6912256# + if ( pTxtNd && pTxtNd->IsInList() ) // <-- - // hier wird Multiselektion nicht beruecksichtigt - if( pRule ) { if( pAny ) { @@ -518,7 +515,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry } eNewState = aCharStyles.getLength() ? - PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;; + PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE; if(pAny) (*pAny) <<= aCharStyles; } -- cgit v1.2.3 From 17a2bbc49320334b23dc93b6caced5047b0107d8 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 15 Mar 2010 16:30:27 +0100 Subject: sw33bf03: #i110012#: sw: ascii export: add space after list label --- sw/source/filter/ascii/ascatr.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 10e85b5c08..08e70f9c78 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -172,7 +172,14 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) SwASC_AttrIter aAttrIter( (SwASCWriter&)rWrt, rNd, nStrPos ); if( !nStrPos && rWrt.bExportPargraphNumbering ) - rWrt.Strm().WriteUnicodeOrByteText( rNd.GetNumString() ); + { + String numString( rNd.GetNumString() ); + if (numString.Len()) + { + numString.Append(' '); + rWrt.Strm().WriteUnicodeOrByteText(numString); + } + } String aStr( rNd.GetTxt() ); if( rWrt.bASCII_ParaAsBlanc ) -- cgit v1.2.3 From 90e8e23ca5ad4143c19ae4b78601359cc8028f83 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 19 Mar 2010 14:59:18 +0100 Subject: c07v027: #i10000# change include svl/svstdarr.hxx to svtools/svstdarr.hxx --- sw/source/core/SwNumberTree/SwNodeNum.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index c13b396e76..996bd156b6 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -41,7 +41,7 @@ #include // <-- // --> OD 2010-01-13 #b6912256# -#include +#include #include // <-- -- cgit v1.2.3