https://bugs.documentfoundation.org/show_bug.cgi?id=151557
Julien Nabet <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |needsUXEval CC| |heiko.tietze@documentfounda | |tion.org, | |[email protected], | |[email protected] --- Comment #5 from Julien Nabet <[email protected]> --- Heiko/Xisco: not sure if it's a bug. Indeed LO goes into to apply the command: 379 case SID_ATTR_PARA_LEFT_TO_RIGHT : 380 case SID_ATTR_PARA_RIGHT_TO_LEFT : 381 { 382 SfxItemSetFixed<RES_PARATR_ADJUST, RES_PARATR_ADJUST> aAdjustSet( GetPool() ); 383 GetShell().GetCurAttr(aAdjustSet); 384 bool bChgAdjust = false; 385 SfxItemState eAdjustState = aAdjustSet.GetItemState(RES_PARATR_ADJUST, false); 386 if(eAdjustState >= SfxItemState::DEFAULT) 387 { 388 SvxAdjust eAdjust = 389 aAdjustSet.Get(RES_PARATR_ADJUST).GetAdjust(); 390 bChgAdjust = (SvxAdjust::Left == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) || 391 (SvxAdjust::Right == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot); 392 } 393 else 394 bChgAdjust = true; (See https://opengrok.libreoffice.org/xref/core/sw/source/uibase/shells/txtattr.cxx?r=d384ccdb#379) It goes in the "else" case (line 394) because selecting the whole table "eAdjustState" var has DONTCARE value DONTCARE corresponds exactly to the whole table: 90 /** Specifies that the property is currently in a don't care state. 91 * <br/> 92 * This is normally used if a selection provides more than one state 93 * for a property at the same time. and DONTCARE < DEFAULT (see "SfxItemState" definition at https://opengrok.libreoffice.org/xref/core/include/svl/poolitem.hxx?r=c351f920#82) Once the direction is modified with: 396 SvxFrameDirection eFrameDirection = 397 (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ? 398 SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB; 399 aSet.Put( SvxFrameDirectionItem( eFrameDirection, RES_FRAMEDIR ) ); 400 the next block tests "bChgAdjust" to know if alignment should be modified: 401 if (bChgAdjust) 402 { 403 SvxAdjust eAdjust = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ? 404 SvxAdjust::Left : SvxAdjust::Right; 405 SvxAdjustItem aAdjust( eAdjust, RES_PARATR_ADJUST ); So if we don't want to change the alignment when selecting the whole table, this patch seems ok: diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 68f4197f5437..6d9011d3f47c 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -390,8 +390,6 @@ SET_LINESPACE: bChgAdjust = (SvxAdjust::Left == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) || (SvxAdjust::Right == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot); } - else - bChgAdjust = true; SvxFrameDirection eFrameDirection = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ? any thoughts? -- You are receiving this mail because: You are the assignee for the bug.
