summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-09-08 13:44:38 +0000
committerOliver Bolte <obo@openoffice.org>2009-09-08 13:44:38 +0000
commit50dde3e4aeeb74226da13aba748ac1d677ec0f5a (patch)
tree597bafb43b986fc2b2f379d7a86c16622ed50169 /sw/source/ui
parentaabbeb69c723fbf3cd4eac8391cdf0acabf66f33 (diff)
CWS-TOOLING: integrate CWS sw32numbf01
2009-09-04 10:01:07 +0200 od r275780 : #i95907# method <SwWrtShell::NumOfBulletOn(..)> - adjust indentation of newly created automatic list style --> due to MRU add actual paragraph indentation to created automatic list style's indentation 2009-09-02 11:57:40 +0200 od r275703 : #i95907# method <SwTxtMargin::CtorInitTxtMargin(..)> - correct handling of paragraph indents, when list level indents are applicable. 2009-09-01 16:59:47 +0200 od r275671 : CWS-TOOLING: rebase CWS sw32numbf01 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:42:34 +0200 od r275540 : #i102458# method <SwFlowFrm::CalcUpperSpace(..)> - correct handling of leading line spacing method <GetSpacingValuesOfFrm(..)> - add output parameter <obIsLineSpacingProportional> 2009-08-27 17:03:07 +0200 od r275496 : #i101516# method <SwTxtNode::SwTxtNode(..)> - in case that the paragraph is add to a list, apply paragraph style's assigned outline style list level as list level, if paragraph has no list level set already. 2009-08-27 15:23:34 +0200 od r275489 : #i101234# method <SwWrtShell::NumOrBulletOn(..)> - check before activation of certain list level of outline numbering, a numbering format is already set. In this only continue the outline numbering. 2009-08-27 14:15:07 +0200 od r275483 : #i95907# method <SwWrtShell::NumOrBulletOn(..)> - consider leading tab stops and intentation of paragraph first text line, when a new list style is created for its application to the selection. 2009-08-26 09:51:39 +0200 od r275401 : #i86492# Adjust copy of text nodes regarding lists - copy of part of paragraph in list does not copy list style and list id - copy of paragraphs in list into another list continues destination list - copy of paragraphs (at least one not in a list) at empty paragraph following a list does not continue the destination list. 2009-08-25 10:30:53 +0200 od r275339 : #i101349# method <XMLTextImportHelper::SetStyleAndAttrs(..) - assure that list style of automatic paragraph style is applied at paragraph.
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/shells/textsh1.cxx34
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx92
2 files changed, 85 insertions, 41 deletions
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 156fada7ee..a0ccd838ac 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -373,7 +373,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if (bForParagraph)
SwLangHelper::SelectCurrentPara( rWrtSh );
-
+
if (!bForSelection) // document language to be changed...
{
rWrtSh.SelAll();
@@ -789,7 +789,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
GetView().GetViewFrame()->ToggleChildWindow(SID_HYPERLINK_DIALOG);
break;
case FN_REMOVE_HYPERLINK:
- {
+ {
BOOL bSel = rWrtSh.HasSelection();
if(!bSel)
{
@@ -1044,7 +1044,14 @@ void SwTextShell::Execute(SfxRequest &rReq)
// --> OD 2008-03-18 #refactorlists#
String sContinuedListId;
const SwNumRule* pRule =
- rWrtSh.SearchNumRule( FALSE, TRUE, FALSE, -1, sContinuedListId );
+ rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId );
+ // --> OD 2009-08-26 #i86492#
+ // Search also for bullet list
+ if ( !pRule )
+ {
+ pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId );
+ }
+ // <--
if ( pRule )
{
rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId );
@@ -1623,14 +1630,23 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_NUM_CONTINUE:
{
- if ( rSh.GetCurNumRule() )
- rSet.DisableItem(nWhich);
- else
+ // --> OD 2009-08-26 #i86492#
+ // Allow continuation of previous list, even if at current cursor
+ // a list is active.
+// if ( rSh.GetCurNumRule() )
+// rSet.DisableItem(nWhich);
+// else
+ // <--
{
- // --> OD 2008-03-18 #refactorlists#
+ // --> OD 2009-08-26 #i86492#
+ // Search also for bullet list
String aDummy;
const SwNumRule* pRule =
- rSh.SearchNumRule( FALSE, TRUE, FALSE, -1, aDummy );
+ rSh.SearchNumRule( false, true, false, -1, aDummy );
+ if ( !pRule )
+ {
+ pRule = rSh.SearchNumRule( false, false, false, -1, aDummy );
+ }
// <--
if ( !pRule )
rSet.DisableItem(nWhich);
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 3e8b72843b..f57a15daed 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -669,10 +669,10 @@ void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point&
try
{
sal_Int32 nState = xObj->getCurrentState();
- if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
+ if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
|| nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
{
- SfxInPlaceClient* pCli =
+ SfxInPlaceClient* pCli =
GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
if ( pCli )
{
@@ -1103,7 +1103,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
pDoc->FindNumRulePtr(pColl->GetNumRule( FALSE ).GetValue());
if ( !pDirectCollRule )
{
- pCollRule = 0L;
+ pCollRule = 0;
}
}
// --> OD 2006-11-20 #i71764#
@@ -1141,12 +1141,9 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
{
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
- //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
- //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL && //#outline level,zhaojianwei
if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei
pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
@@ -1162,31 +1159,40 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
}
else
{
+ // --> OD 2009-08-27 #i101234#
// activate outline numbering, because from the precondition
// it's known, that <SwEdit::HasNumber()> == FALSE
bActivateOutlineRule = true;
- //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
}
}
else if ( !pNumRule )
{
- // activate outline numbering, because from the precondition
- // it's known, that <SwEdit::HasNumber()> == FALSE
- bActivateOutlineRule = true;
- //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
+ // --> OD 2009-08-27 #i101234#
+ // Check, if corresponding list level of the outline numbering
+ // has already a numbering format set.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
+ if ( pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
+ == SVX_NUM_NUMBER_NONE )
+ {
+ // activate outline numbering, because from the precondition
+ // it's known, that <SwEdit::HasNumber()> == FALSE
+ bActivateOutlineRule = true;
+ }
+ else
+ {
+ // turning on outline numbering at current cursor position
+ bContinueFoundNumRule = true;
+ }
+ // <--
}
else
{
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
- //nActivateOutlineLvl = pColl->GetOutlineLevel();
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
- //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&
if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
@@ -1212,12 +1218,12 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
{
if ( !pNumRule->IsAutoRule() )
{
- pNumRule = 0L;
+ pNumRule = 0;
}
else if ( pNumRule == GetDoc()->GetOutlineNumRule() &&
!bActivateOutlineRule && !bContinueFoundNumRule )
{
- pNumRule = 0L;
+ pNumRule = 0;
}
}
// <--
@@ -1229,7 +1235,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
if ( !pNumRule )
{
pNumRule = GetDoc()->SearchNumRule( *GetCrsr()->GetPoint(),
- FALSE, bNum, FALSE, 0,
+ false, bNum, false, 0,
sContinuedListId );
bContinueFoundNumRule = pNumRule != 0;
}
@@ -1290,11 +1296,12 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
}
else
{
+ // --> OD 2009-08-27 #i95907#
+ const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
+ numfunc::GetDefaultPositionAndSpaceMode() );
// --> OD 2008-02-11 #newlistlevelattrs#
- SwNumRule aNumRule( GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
- numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
+ SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
+ // <--
// <--
// Zeichenvorlage an die Numerierung haengen
SwCharFmt* pChrFmt;
@@ -1315,9 +1322,10 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
pChrFmt = GetCharFmtFromPool( RES_POOLCHR_BUL_LEVEL );
}
- SwTxtNode * pTxtNode =
- GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
- USHORT nWidthOfTabs = pTxtNode->GetWidthOfLeadingTabs();
+ const SwTxtNode* pTxtNode = GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
+ const SwTwips nWidthOfTabs = pTxtNode
+ ? pTxtNode->GetWidthOfLeadingTabs()
+ : 0;
GetDoc()->RemoveLeadingWhiteSpace( *GetCrsr()->GetPoint() );
const bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh);
@@ -1339,16 +1347,21 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
}
- if(bHtml && nLvl)
+ // --> OD 2009-08-26 #i95907#
+ if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
- // 1/2" fuer HTML
- aFmt.SetLSpace(720);
- aFmt.SetAbsLSpace(nLvl * 720);
- }
- else if ( nWidthOfTabs > 0 )
- {
- aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
+ if(bHtml && nLvl)
+ {
+ // 1/2" fuer HTML
+ aFmt.SetLSpace(720);
+ aFmt.SetAbsLSpace(nLvl * 720);
+ }
+ else if ( nWidthOfTabs > 0 )
+ {
+ aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
+ }
}
+ // <--
// --> FME 2005-01-21 #i38904# Default alignment for
// numbering/bullet should be rtl in rtl paragraph:
@@ -1361,6 +1374,21 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
aNumRule.Set( nLvl, aFmt );
}
+ // --> OD 2009-08-26 #i95907#
+ if ( pTxtNode &&
+ ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ short nTxtNodeFirstLineOffset( 0 );
+ pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset );
+ const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() +
+ nTxtNodeFirstLineOffset;
+ if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
+ {
+ const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+ aNumRule.ChangeIndent( nIndentChange );
+ }
+ }
+ // <--
// --> OD 2008-02-08 #newlistlevelattrs#
// reset indent attribute on applying list style
// --> OD 2008-03-17 #refactorlists#