[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 4 commits - desktop/source sw/source
Oliver-Rainer Wittmann
orw at apache.org
Fri Aug 23 03:11:28 PDT 2013
desktop/source/app/app.cxx | 14
desktop/source/deployment/gui/dp_gui_handleversionexception.cxx | 67 ++-
desktop/source/inc/dp_gui_handleversionexception.hxx | 5
desktop/source/migration/services/oo3extensionmigration.cxx | 5
sw/source/ui/docvw/edtwin.cxx | 179 +---------
5 files changed, 75 insertions(+), 195 deletions(-)
New commits:
commit ed13d17d8849705ba9f629cb813deaa8db7d5419
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Aug 23 09:51:25 2013 +0000
122976: suppress user interaction on install of already installed extension during the 'silent' installation of the so-called bundled extensions and during the migration of extensions from a former user profile
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index bd2cb86..6689f04 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -801,8 +801,9 @@ void MinimalCommandEnv::handle(
css::deployment::VersionException verExc;
if ( xRequest->getRequest() >>= verExc )
{
- // user interaction, if an extension is already been installed.
- bApprove = handleVersionException( verExc );
+ // choose newest version, if an extension is already been installed.
+ const bool bChooseNewestVersion = true;
+ bApprove = handleVersionException( verExc, 0, bChooseNewestVersion );
}
const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > conts( xRequest->getContinuations());
diff --git a/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx b/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
index 624ab45..56d00f3 100644
--- a/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
+++ b/desktop/source/deployment/gui/dp_gui_handleversionexception.cxx
@@ -53,7 +53,8 @@ extern "C" {
bool handleVersionException(
com::sun::star::deployment::VersionException verExc,
- DialogHelper* pDialogHelper )
+ DialogHelper* pDialogHelper,
+ const bool bChooseNewestVersion )
{
bool bApprove = false;
@@ -72,37 +73,45 @@ bool handleVersionException(
break;
}
OSL_ASSERT( verExc.Deployed.is() );
- const bool bEqualNames = verExc.NewDisplayName.equals(
- verExc.Deployed->getDisplayName());
+
+ if ( bChooseNewestVersion )
{
- vos::OGuard guard(Application::GetSolarMutex());
- WarningBox box( pDialogHelper ? pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
- String s;
- if (bEqualNames)
- {
- s = box.GetMessText();
- }
- else if (id == RID_WARNINGBOX_VERSION_EQUAL)
- {
- //hypothetical: requires two instances of an extension with the same
- //version to have different display names. Probably the developer forgot
- //to change the version.
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
- }
- else if (id == RID_WARNINGBOX_VERSION_LESS)
- {
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
- }
- else if (id == RID_WARNINGBOX_VERSION_GREATER)
+ bApprove = id == RID_WARNINGBOX_VERSION_GREATER;
+ }
+ else
+ {
+ const bool bEqualNames = verExc.NewDisplayName.equals(
+ verExc.Deployed->getDisplayName());
{
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ vos::OGuard guard(Application::GetSolarMutex());
+ WarningBox box( pDialogHelper ? pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
+ String s;
+ if (bEqualNames)
+ {
+ s = box.GetMessText();
+ }
+ else if (id == RID_WARNINGBOX_VERSION_EQUAL)
+ {
+ //hypothetical: requires two instances of an extension with the same
+ //version to have different display names. Probably the developer forgot
+ //to change the version.
+ s = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ else if (id == RID_WARNINGBOX_VERSION_LESS)
+ {
+ s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ else if (id == RID_WARNINGBOX_VERSION_GREATER)
+ {
+ s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ }
+ s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
+ s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
+ s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
+ s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
+ box.SetMessText(s);
+ bApprove = box.Execute() == RET_OK;
}
- s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
- s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
- s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
- s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
- box.SetMessText(s);
- bApprove = box.Execute() == RET_OK;
}
return bApprove;
diff --git a/desktop/source/inc/dp_gui_handleversionexception.hxx b/desktop/source/inc/dp_gui_handleversionexception.hxx
index 32272aa..2a4fd50 100755
--- a/desktop/source/inc/dp_gui_handleversionexception.hxx
+++ b/desktop/source/inc/dp_gui_handleversionexception.hxx
@@ -30,10 +30,13 @@ namespace dp_gui{ class DialogHelper; }
extern "C" {
+ // optional parameter <bChooseNewestVersion> indicates, if
+ // the newest version is chosen without user interaction.
DESKTOP_DEPLOYMENTGUI_DLLPUBLIC
bool handleVersionException(
com::sun::star::deployment::VersionException verExc,
- dp_gui::DialogHelper* pDialogHelper = 0 );
+ dp_gui::DialogHelper* pDialogHelper = 0,
+ const bool bChooseNewestVersion = false );
}
#endif
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 03dd9515..795d01f 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -530,8 +530,9 @@ void TmpRepositoryCommandEnv::handle(
deployment::VersionException verExc;
if ( xRequest->getRequest() >>= verExc )
{
- // user interaction, if an extension is already been installed.
- approve = handleVersionException( verExc );
+ // choose newest version, if an extension is already been installed.
+ const bool bChooseNewestVersion = true;
+ approve = handleVersionException( verExc, 0, bChooseNewestVersion );
abort = !approve;
}
commit c68c57a1e021ebef7fb79fd0b4d3ab21dcaf41b2
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Aug 23 09:42:06 2013 +0000
122976: <installBundledExtensionBlobs()> - handle exceptions thrown by the extension manager
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1b82e41..bd2cb86 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -954,6 +954,15 @@ static void installBundledExtensionBlobs()
{}
catch( css::deployment::DeploymentException&)
{}
+ catch ( css::ucb::CommandFailedException& )
+ {
+ }
+ catch ( css::ucb::CommandAbortedException& )
+ {
+ }
+ catch ( css::lang::IllegalArgumentException& )
+ {
+ }
}
}
commit 4dd71466a9463d234b918ce2729c49a57293fb24
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Aug 23 08:42:38 2013 +0000
123051: some minor code clean up
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index af71c15..e51cf48 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -116,17 +116,14 @@
#include <helpid.h>
#include <cmdid.h>
-#ifndef _DOCVW_HRC
#include <docvw.hrc>
-#endif
#include <uitool.hxx>
-// OD 18.09.2003 #i18732#
#include <fmtfollowtextflow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <charfmt.hxx>
#include <numrule.hxx>
#include <pagedesc.hxx>
-#include <svtools/ruler.hxx> // #i23726#
+#include <svtools/ruler.hxx>
#include "formatclipboard.hxx"
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -137,11 +134,6 @@
#include <PostItMgr.hxx>
-//JP 11.10.2001: enable test code for bug fix 91313
-#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1)
-//#define TEST_FOR_BUG91313
-#endif
-
using namespace sw::mark;
using namespace ::com::sun::star;
@@ -189,17 +181,13 @@ class SwAnchorMarker
SdrHdl* pHdl;
Point aHdlPos;
Point aLastPos;
- // --> OD 2010-09-16 #i114522#
bool bTopRightHandle;
- // <--
public:
SwAnchorMarker( SdrHdl* pH )
: pHdl( pH )
, aHdlPos( pH->GetPos() )
, aLastPos( pH->GetPos() )
- // --> OD 2010-09-16 #i114522#
, bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR )
- // <--
{}
const Point& GetLastPos() const { return aLastPos; }
void SetLastPos( const Point& rNew ) { aLastPos = rNew; }
@@ -210,14 +198,11 @@ public:
void ChgHdl( SdrHdl* pNew )
{
pHdl = pNew;
- // --> OD 2010-09-16 #i114522#
if ( pHdl )
{
bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR);
}
- // <--
}
- // --> OD 2010-09-16 #i114522#
const Point GetPosForHitTest( const OutputDevice& rOut )
{
Point aHitTestPos( GetPos() );
@@ -234,7 +219,6 @@ public:
return aHitTestPos;
}
- // <--
};
struct QuickHelpData
@@ -323,7 +307,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
delete pUserMarker;
pUserMarker = 0L;
}
-// rSh.SwCrsrShell::UnSetVisCrsr( rLPt );
eStyle = POINTER_NOTALLOWED;
}
else
@@ -639,11 +622,7 @@ void SwEditWin::JustifyAreaTimer()
nDiff = Max(
Max( aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - aMovePos.Y() ),
Max( aMovePos.X() - rVisArea.Right(), rVisArea.Left() - aMovePos.X()));
-#ifdef TEST_FOR_BUG91313
aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff) );
-#else
- aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff*2L) );
-#endif
}
void SwEditWin::LeaveArea(const Point &rPos)
@@ -679,9 +658,6 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect )
{
SetSdrDrawMode( eSdrObjectKind );
-/* if (GetDrawFuncPtr())
- GetDrawFuncPtr()->Deactivate();*/
-
if (bObjSelect)
rView.SetDrawFuncPtr(new DrawSelection( &rView.GetWrtShell(), this, &rView ));
else
@@ -1019,13 +995,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
SwRect aBoundRect;
Point aRefPoint;
- // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
- // aligned to page for fly frame anchored to paragraph or to character.
{
SwFmtVertOrient aVert( (SwFmtVertOrient&)aSet.Get(RES_VERT_ORIENT) );
const bool bFollowTextFlow =
static_cast<const SwFmtFollowTextFlow&>(aSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue();
- // OD 12.11.2003 #i22341# - additional provide content position
const SwPosition* pToCharCntntPos = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetCntntAnchor();
rSh.CalcBoundRect( aBoundRect, eAnchorId,
text::RelOrientation::FRAME, aVert.GetRelationOrient(),
@@ -1164,11 +1137,8 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb )
---------------------------------------------------------------------------*/
void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
{
- // --> OD 2005-01-31 #i40845# - start undo action in order to get only one
- // undo action for this change.
SwWrtShell &rSh = rView.GetWrtShell();
rSh.StartUndo();
- // <--
long nX = 0;
long nY = 0;
@@ -1244,8 +1214,6 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
// if the object's position is not protected
if(0 == (nProtect&FLYPROTECT_POS))
{
- // --> FME 2005-04-26 #i47138#
- // Check if object is anchored as character and move direction
sal_Bool bDummy1, bDummy2;
const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 );
const bool bHoriMove = !bVertAnchor == !( nDir % 2 );
@@ -1253,7 +1221,6 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
!bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR);
if ( bMoveAllowed )
{
- // <--
pSdrView->MoveAllMarked(Size(nX, nY));
rSh.SetModified();
}
@@ -1309,9 +1276,7 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
rSh.EndAllAction();
}
- // --> OD 2005-01-31 #i40845# - end undo action
rSh.EndUndo();
- // <--
}
/*--------------------------------------------------------------------
@@ -1554,13 +1519,11 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
eNextKeyState = KS_Ende;
sal_uInt8 nDir = 0;
- // -> #i23725#
if (nKS_NUMDOWN_Count > 0)
nKS_NUMDOWN_Count--;
if (nKS_NUMINDENTINC_Count > 0)
nKS_NUMINDENTINC_Count--;
- // <- #i23725#
while( KS_Ende != eKeyState )
{
@@ -1667,13 +1630,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
nDir = MOVE_DOWN_SMALL;
goto KEYINPUT_CHECKTABLE;
-// case KEY_UP | KEY_MOD2 | KEY_SHIFT:
-// eKeyState = KS_ColTopBig;
-// goto KEYINPUT_CHECKTABLE;
-// case KEY_DOWN | KEY_MOD2 | KEY_SHIFT:
-// eKeyState = KS_ColTopSmall;
-// goto KEYINPUT_CHECKTABLE;
-
case KEY_UP | KEY_MOD2 | KEY_MOD1:
eKeyState = KS_CellBottomSmall;
goto KEYINPUT_CHECKTABLE;
@@ -1750,7 +1706,6 @@ KEYINPUT_CHECKTABLE:
nTblChgSize = pModOpt->GetTblVInsert();
}
goto KEYINPUT_CHECKTABLE_INSDEL;
-// case KEY_RIGHT:
case KEY_RIGHT | KEY_MOD1:
{
eTblChgMode = nsTblChgWidthHeightType::WH_FLAG_INSDEL | nsTblChgWidthHeightType::WH_CELL_RIGHT;
@@ -1892,13 +1847,10 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KEY_BACKSPACE | KEY_SHIFT:
if( !rSh.HasReadonlySel() )
{
- // #i23725#
sal_Bool bDone = sal_False;
- // --> OD 2006-01-31 - try to add comment for code snip:
// Remove the paragraph indent, if the cursor is at the
// beginning of a paragraph, there is no selection
// and no numbering rule found at the current paragraph
- // --> OD 2006-01-31 #b6341339#, #i58776#
// Also try to remove indent, if current paragraph
// has numbering rule, but isn't counted and only
// key <backspace> is hit.
@@ -1911,9 +1863,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
bDone = rSh.TryRemoveIndent();
}
- // <--
- // -> #i23725#
if (bDone)
eKeyState = KS_Ende;
else
@@ -1935,10 +1885,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
bDone = sal_True;
}
}
- // <- #i23725#
- // --> OD 2006-01-31 #b6341339#, #i58776#
- // --> OD 2006-04-21 #i63540#
- // revise fix for issues b6341339 and i58776:
// If the cursor is in an empty paragraph, which has
// a numbering, but not the oultine numbering, and
// there is no selection, the numbering has to be
@@ -2007,11 +1953,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
{
- // --> OD 2007-10-02 #b660435#
-// if (rSh.IsFirstOfNumRule()) // #i23725#
if ( rSh.IsFirstOfNumRule() &&
numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
- // <--
eKeyState = KS_NumIndentInc;
else
eKeyState = KS_NumDown;
@@ -2062,11 +2005,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() &&
!rSh.HasReadonlySel() )
{
- // --> OD 2007-10-02 #b660435#
-// if (rSh.IsFirstOfNumRule()) // #i23725#
if ( rSh.IsFirstOfNumRule() &&
numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
- // <--
eKeyState = KS_NumIndentDec;
else
eKeyState = KS_NumUp;
@@ -2319,7 +2259,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KS_InsTab:
if( rView.ISA( SwWebView )) //Kein Tabulator fuer Web!
{
- // Bug 56196 - dann sollte der weiter gereicht werden.
Window::KeyInput( aKeyEvent );
eKeyState = KS_Ende;
break;
@@ -2343,17 +2282,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
"where is the otherpos?");
if (pFieldmark->IsExpanded())
{
- SwPaM aPaM(pFieldmark->GetMarkPos(), pFieldmark->GetOtherMarkPos());
- if(0)
- {
- rSh.StartAllAction(); //$flr TODO: understand why this not works
- pDoc->SetModified(aPaM);
- rSh.EndAllAction();
- }
- else
- {
- rSh.CalcLayout(); // workaround
- }
+ rSh.CalcLayout();
}
}
eKeyState = KS_Ende;
@@ -2411,7 +2340,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
else
{
InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute();
- // ??? Window::KeyInput( aKeyEvent );
eKeyState = KS_Ende;
}
break;
@@ -2424,12 +2352,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
ChgToEnEmDash | SetINetAttr |
Autocorrect ) &&
!rSh.HasReadonlySel() )
- /* {
- pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
- ChgFractionSymbol | ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr |
- Autocorrect ) &&
- !rSh.HasReadonlySel() ) */
{
FlushInBuffer();
rSh.AutoCorrect( *pACorr, static_cast< sal_Unicode >('\0') );
@@ -2442,8 +2364,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
sal_uInt16 nSlotId = 0;
FlushInBuffer();
-//??? if( bFlushCharBuffer )
-//??? FlushInBuffer( &rSh );
switch( eKeyState )
{
case KS_SpecialInsert:
@@ -2470,11 +2390,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.NumUpDown( sal_False );
break;
- // -> #i23726#
case KS_NumIndentInc:
- // --> OD 2008-06-16 #i90078#
rSh.ChangeIndentOfAllListLevels(360);
- // <--
nKS_NUMINDENTINC_Count = 2;
break;
@@ -2493,11 +2410,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KS_NumIndentDec:
- // --> OD 2008-06-16 #i90078#
rSh.ChangeIndentOfAllListLevels(-360);
// <--
break;
- // <- #i23726#
case KS_OutlineDown:
rSh.OutlineUpDown( 1 );
@@ -2519,8 +2434,6 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.SplitNode( sal_True );
break;
-// case KS_NumOrNoNum:
-// break;
case KS_NextObject:
case KS_PrevObject:
if(rSh.GotoObj( KS_NextObject == eKeyState, GOTOOBJ_GOTO_ANY))
@@ -2590,9 +2503,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KS_ColRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
case KS_ColLeftSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_LEFT, pModOpt->GetTblHMove() ); break;
case KS_ColRightSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_COL_RIGHT, pModOpt->GetTblHMove() ); break;
-// case KS_ColTopBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break;
case KS_ColBottomBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblVMove() ); break;
-// case KS_ColTopSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_TOP, pModOpt->GetTblVMove() ); break;
case KS_ColBottomSmall: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_ROW_BOTTOM, pModOpt->GetTblVMove() ); break;
case KS_CellLeftBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_LEFT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
case KS_CellRightBig: rSh.SetColRowWidthHeight( nsTblChgWidthHeightType::WH_CELL_RIGHT|nsTblChgWidthHeightType::WH_FLAG_BIGGER, pModOpt->GetTblHMove() ); break;
@@ -2784,7 +2695,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) &&
!rSh.IsObjSelectable( aDocPos ) )
{
- // --> FME 2004-07-30 #i32329# Enhanced table selection
+ // Enhanced table selection
if ( SW_TABSEL_HORI <= nMouseTabCol && SW_TABCOLSEL_VERT >= nMouseTabCol )
{
rSh.EnterStdMode();
@@ -2800,7 +2711,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
return;
}
- // <--
if ( !rSh.IsTableMode() )
{
@@ -2829,7 +2739,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
}
- // #i23726#
else if (bTmp &&
rSh.IsNumLabel(aDocPos))
{
@@ -2839,10 +2748,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
SfxBindings& rBind = rView.GetViewFrame()->GetBindings();
rBind.Update();
- // --> OD 2005-02-21 #i42921#
if ( RulerMarginDrag( rMEvt,
rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPos ) ) )
- // <--
{
rView.SetNumRuleNodeFromDoc( NULL );
rView.InvalidateRulerPos();
@@ -2851,11 +2758,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
else
{
- // --> FME 2005-11-03 #125036# Make sure the pointer is set to 0,
- // otherwise it may point to nowhere after deleting the corresponding
- // text node.
+ // Make sure the pointer is set to 0, otherwise it may point to
+ // nowhere after deleting the corresponding text node.
rView.SetNumRuleNodeFromDoc( NULL );
- // <--
return;
}
}
@@ -2896,7 +2801,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
( pHdl->GetKind() == HDL_ANCHOR ||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
{
- // #121463# Set selected during drag
+ // Set selected during drag
pHdl->SetSelected(true);
pAnchorMarker = new SwAnchorMarker( pHdl );
UpdatePointer( aDocPos, rMEvt.GetModifier() );
@@ -2955,11 +2860,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bExecHyperlinks = sal_True;
}
- // --> FME 2004-07-30 #i32329# Enhanced selection
+ // Enhanced selection
sal_uInt8 nNumberOfClicks = static_cast< sal_uInt8 >(rMEvt.GetClicks() % 4);
if ( 0 == nNumberOfClicks && 0 < rMEvt.GetClicks() )
nNumberOfClicks = 4;
- // <--
sal_Bool bExecDrawTextLink = sal_False;
@@ -2992,7 +2896,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
!GetView().GetViewFrame()->GetDispatcher()->IsLocked() &&
!bExecDrawTextLink)
{
- // #107513#
// Test if there is a draw object at that position and if it should be selected.
sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos);
@@ -3230,12 +3133,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if ( bMod )
rSh.EnterAddMode();
- // --> FME 2004-07-30 #i32329# Enhanced selection
+ // Enhanced selection
if ( 3 == nNumberOfClicks )
rSh.SelSentence( &aDocPos );
else
rSh.SelPara( &aDocPos );
- // <--
if ( bMod )
rSh.LeaveAddMode();
@@ -3480,13 +3382,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if ( !bOverURLGrf && !bOnlyText )
{
const int nSelType = rSh.GetSelectionType();
- // --> OD 2009-12-30 #i89920#
// Check in general, if an object is selectable at given position.
// Thus, also text fly frames in background become selectable via Ctrl-Click.
if ( nSelType & nsSelectionType::SEL_OLE ||
nSelType & nsSelectionType::SEL_GRF ||
rSh.IsObjSelectable( aDocPos ) )
- // <--
{
MV_KONTEXT( &rSh );
if( !rSh.IsFrmSelected() )
@@ -3495,11 +3395,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
bCallBase = sal_False;
}
}
- // nicht mehr hier zuruecksetzen, damit -- falls durch MouseMove
- // bei gedrueckter Ctrl-Taste eine Mehrfachselektion erfolgen soll,
- // im Drag nicht die vorherige Selektion aufgehoben wird.
-// if(bModePushed)
-// rSh.PopMode(sal_False);
break;
}
}
@@ -3564,20 +3459,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
}
const Point aOldPt( rSh.VisArea().Pos() );
-#ifdef TEST_FOR_BUG91313
- // n Pixel as FUZZY border
- SwRect aVis( rSh.VisArea() );
- Size aFuzzySz( 2, 2 );
- aFuzzySz = PixelToLogic( aFuzzySz );
-
- aVis.Top( aVis.Top() + aFuzzySz.Height() );
- aVis.Bottom( aVis.Bottom() - aFuzzySz.Height() );
- aVis.Left( aVis.Left() + aFuzzySz.Width() );
- aVis.Right( aVis.Right() - aFuzzySz.Width() );
- const sal_Bool bInsWin = aVis.IsInside( aDocPt );
-#else
const sal_Bool bInsWin = rSh.VisArea().IsInside( aDocPt );
-#endif
if( pShadCrsr && !bInsWin )
delete pShadCrsr, pShadCrsr = 0;
@@ -3658,7 +3540,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
nPointer = POINTER_HSIZEBAR;
bChkTblSel = true;
break;
- // --> FME 2004-07-30 #i20126# Enhanced table selection
+ // Enhanced table selection
case SW_TABSEL_HORI :
nPointer = POINTER_TAB_SELECT_SE;
break;
@@ -3677,31 +3559,25 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
case SW_TABCOLSEL_VERT :
nPointer = POINTER_TAB_SELECT_W;
break;
- // <--
}
if ( USHRT_MAX != nPointer &&
- // --> FME 2004-10-20 #i35543#
// Enhanced table selection is explicitely allowed in table mode
( !bChkTblSel || !rSh.IsTableMode() ) )
- // <--
{
SetPointer( nPointer );
}
return;
}
- // #i23726#
else if (rSh.IsNumLabel(aDocPt, RULER_MOUSE_MARGINWIDTH))
{
- // --> OD 2005-02-21 #i42921# - consider vertical mode
SwTxtNode* pNodeAtPos = rSh.GetNumRuleNodeAtPos( aDocPt );
const sal_uInt16 nPointer =
rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPt )
? POINTER_VSIZEBAR
: POINTER_HSIZEBAR;
SetPointer( nPointer );
- // <--
return;
}
@@ -3723,10 +3599,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
// So the pAnchorMarker has to find the right SdrHdl, if it's
// the old one, it will find it with position aOld, if this one
// is destroyed, it will find a new one at position GetHdlPos().
- // --> OD 2010-09-16 #i114522#
-// const Point aOld = pAnchorMarker->GetPos();
const Point aOld = pAnchorMarker->GetPosForHitTest( *(rSh.GetOut()) );
- // <--
Point aNew = rSh.FindAnchorPos( aDocPt );
SdrHdl* pHdl;
if( (0!=( pHdl = pSdrView->PickHandle( aOld ) )||
@@ -3739,7 +3612,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
{
pAnchorMarker->SetPos( aNew );
pAnchorMarker->SetLastPos( aDocPt );
- //OLMpSdrView->RefreshAllIAOManagers();
}
}
else
@@ -3801,9 +3673,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( 0 != ( pFlyFmt = rSh.GetFlyFrmFmt() ) &&
0 != ( pMacro = pFlyFmt->GetMacro().GetMacroTable().
Get( nEvent )) &&
-// oder nur z.B. alle 20 Twip bescheid sagen?
-// ( 20 > Abs( aRszMvHdlPt.X() - aDocPt.X() ) ||
-// 20 > Abs( aRszMvHdlPt.Y() - aDocPt.Y() ) )
aRszMvHdlPt != aDocPt )
{
aRszMvHdlPt = aDocPt;
@@ -4061,10 +3930,6 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
//MouseButtonUp nur bearbeiten, wenn auch das Down an dieses Fenster ging.
if ( !bMBPressed )
{
-// OS 25.02.97 Undo fuer die Giesskann ist bereits im CommandHdl
-//JP 29.09.95: so sollte es sein!!! if(pApplyTempl->bUndo)
-// if( pApplyTempl && MOUSE_RIGHT == rMEvt.GetModifier() + rMEvt.GetButtons() )
-// rSh.Do( SwWrtShell::UNDO );
return;
}
@@ -4088,12 +3953,11 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
if(pAnchorMarker->GetHdl())
{
- // #121463# delete selected after drag
+ // delete selected after drag
pAnchorMarker->GetHdl()->SetSelected(false);
}
Point aPnt( pAnchorMarker->GetLastPos() );
- //OLMpSdrView->RefreshAllIAOManagers();
DELETEZ( pAnchorMarker );
if( aPnt.X() || aPnt.Y() )
rSh.FindAnchorPos( aPnt, sal_True );
@@ -4339,8 +4203,6 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if ( aCntntAtPos.aFnd.pFldmark != NULL)
{
IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
- //SwDocShell* pDocSh = rView.GetDocShell();
- //SwDoc *pDoc=pDocSh->GetDoc();
if (fieldBM->GetFieldname( ).equalsAscii( ODF_FORMCHECKBOX ) )
{
ICheckboxFieldmark* pCheckboxFm = dynamic_cast<ICheckboxFieldmark*>(fieldBM);
@@ -4555,11 +4417,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
case SFX_STYLE_FAMILY_PSEUDO:
if( !rSh.HasReadonlySel() )
{
- // --> OD 2008-03-17 #refactorlists#
rSh.SetCurNumRule( *pApplyTempl->aColl.pNumRule,
false,
pApplyTempl->aColl.pNumRule->GetDefaultListId() );
- // <--
bCallBase = sal_False;
pApplyTempl->bUndo = sal_True;
if( pApplyTempl->aColl.pNumRule )
@@ -4684,8 +4544,8 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView):
bLockInput(sal_False),
bObjectSelect( sal_False ),
- nKS_NUMDOWN_Count(0), // #i23725#
- nKS_NUMINDENTINC_Count(0) // #i23725#
+ nKS_NUMDOWN_Count(0),
+ nKS_NUMINDENTINC_Count(0)
{
SetHelpId(HID_EDIT_WIN);
EnableChildTransparentMode();
@@ -4776,7 +4636,6 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
SwWrtShell &rSh = rView.GetWrtShell();
SdrView *pSdrView = rSh.GetDrawView();
-// if ( GetDrawFuncPtr() && (aActHitType == SDRHIT_NONE || rSh.IsDrawCreate()) )
if ( rView.GetDrawFuncPtr() )
{
if (rSh.IsDrawCreate())
@@ -4818,7 +4677,6 @@ sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos)
sal_Bool SwEditWin::IsDrawSelMode()
{
-// return (IsFrmAction() == sal_False && GetSdrDrawMode() == OBJ_NONE);
return IsObjectSelect();
}
@@ -5316,18 +5174,15 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
{
sal_Bool bRet = sal_False;
const Point aDocPos( PixelToLogic( rMousePos ) );
- // --> OD 2005-02-17 #i42258#
const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aDocPos ) );
- // <--
//create a synthetic mouse event out of the coordinates
MouseEvent aMEvt(rMousePos);
SdrView *pSdrView = rSh.GetDrawView();
if ( pSdrView )
{
- // --> OD 2005-02-17 #i42258# - no close of insert_draw and reset of
- // draw mode, if context menu position is inside a selected object.
+ // no close of insert_draw and reset of draw mode,
+ // if context menu position is inside a selected object.
if ( !bIsInsideSelectedObj && rView.GetDrawFuncPtr() )
- // <--
{
rView.GetDrawFuncPtr()->Deactivate();
commit 09c64ae86baf3572856c845e0785692b2cbfe058
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Aug 23 08:25:14 2013 +0000
123051: handling SHIFT-<arrow key>: huge object move only when object is selected.
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 392d982..af71c15 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1714,8 +1714,10 @@ KEYINPUT_CHECKTABLE:
case KEY_UP | KEY_SHIFT:
case KEY_DOWN | KEY_SHIFT:
{
- if ( pFlyFmt
- || ( (rSh.GetSelectionType() & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM))
+ const int nSelectionType = rSh.GetSelectionType();
+ if ( ( pFlyFmt
+ && ( nSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF) ) )
+ || ( ( nSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM) )
&& rSh.GetDrawView()->AreObjectsMarked() ) )
{
eKeyState = pFlyFmt ? KS_Fly_Change : KS_Draw_Change;
More information about the Libreoffice-commits
mailing list