2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-27 16:10:40 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 12:41:53 +00:00
|
|
|
#include "futext.hxx"
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/eeitem.hxx>
|
|
|
|
#include <editeng/editerr.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/dlgutil.hxx>
|
|
|
|
#include <svx/svxerr.hxx>
|
2003-04-24 13:39:18 +00:00
|
|
|
#include <tools/urlobj.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/help.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/editstat.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/aeitem.hxx>
|
|
|
|
#include <svl/intitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svdotext.hxx>
|
|
|
|
#include <svx/svdogrp.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/flditem.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/style.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/editeng.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svdoutl.hxx>
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <sfx2/docfile.hxx>
|
2000-11-17 10:13:31 +00:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/outlobj.hxx>
|
2009-12-10 18:36:58 +01:00
|
|
|
#include <svtools/langtab.hxx>
|
2002-11-15 13:46:44 +00:00
|
|
|
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/frmdiritem.hxx>
|
2002-11-15 13:46:44 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
#include <svx/svdetc.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/editview.hxx>
|
2008-03-12 10:40:54 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "app.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
2004-01-20 12:41:53 +00:00
|
|
|
#include "ViewShell.hxx"
|
2006-03-21 16:19:05 +00:00
|
|
|
#include "ViewShellBase.hxx"
|
2004-01-20 12:41:53 +00:00
|
|
|
#include "View.hxx"
|
|
|
|
#include "Outliner.hxx"
|
|
|
|
#include "Window.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "drawdoc.hxx"
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
#include "sdmod.hxx"
|
2004-01-20 12:41:53 +00:00
|
|
|
#include "FrameView.hxx"
|
2006-03-21 16:19:05 +00:00
|
|
|
#include "ToolBarManager.hxx"
|
2004-01-20 12:41:53 +00:00
|
|
|
#include "DrawDocShell.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "glob.hrc"
|
|
|
|
#include "pres.hxx"
|
2001-04-24 10:34:01 +00:00
|
|
|
#include "optsitem.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
2000-10-25 09:34:04 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::linguistic2;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 12:41:53 +00:00
|
|
|
namespace sd {
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
static sal_uInt16 SidArray[] = {
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_STYLE_FAMILY2, // 5542
|
|
|
|
SID_STYLE_FAMILY5, // 5545
|
2012-08-03 20:30:53 +04:00
|
|
|
SID_REDO, // 5700
|
|
|
|
SID_UNDO, // 5701
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_CUT, // 5710
|
|
|
|
SID_COPY, // 5711
|
2001-06-29 12:07:04 +00:00
|
|
|
SID_ATTR_TABSTOP, // 10002
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_ATTR_CHAR_FONT, // 10007
|
|
|
|
SID_ATTR_CHAR_POSTURE, // 10008
|
|
|
|
SID_ATTR_CHAR_WEIGHT, // 10009
|
2015-06-08 12:21:01 +01:00
|
|
|
SID_ATTR_CHAR_SHADOWED, // 10010
|
|
|
|
SID_ATTR_CHAR_STRIKEOUT, // 10013
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_ATTR_CHAR_UNDERLINE, // 10014
|
|
|
|
SID_ATTR_CHAR_FONTHEIGHT, // 10015
|
|
|
|
SID_ATTR_CHAR_COLOR, // 10017
|
2015-06-08 12:21:01 +01:00
|
|
|
SID_ATTR_CHAR_KERNING, // 10018
|
|
|
|
SID_ATTR_CHAR_CASEMAP, // 10019
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_ATTR_PARA_ADJUST_LEFT, // 10028
|
|
|
|
SID_ATTR_PARA_ADJUST_RIGHT, // 10029
|
|
|
|
SID_ATTR_PARA_ADJUST_CENTER, // 10030
|
|
|
|
SID_ATTR_PARA_ADJUST_BLOCK, // 10031
|
|
|
|
SID_ATTR_PARA_LINESPACE_10, // 10034
|
|
|
|
SID_ATTR_PARA_LINESPACE_15, // 10035
|
|
|
|
SID_ATTR_PARA_LINESPACE_20, // 10036
|
2013-04-10 08:20:16 +00:00
|
|
|
SID_ATTR_PARA_ULSPACE, // 10042
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_ATTR_PARA_LRSPACE, // 10043
|
2013-04-10 08:20:16 +00:00
|
|
|
SID_ATTR_TRANSFORM_POS_X, // 10088
|
|
|
|
SID_ATTR_TRANSFORM_POS_Y, // 10089
|
|
|
|
SID_ATTR_TRANSFORM_WIDTH, // 10090
|
|
|
|
SID_ATTR_TRANSFORM_HEIGHT,// 10091
|
|
|
|
SID_ATTR_TRANSFORM_ROT_X, // 10093
|
|
|
|
SID_ATTR_TRANSFORM_ROT_Y, // 10094
|
|
|
|
SID_ATTR_TRANSFORM_ANGLE, // 10095 //Added
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_OUTLINE_UP, // 10150
|
|
|
|
SID_OUTLINE_DOWN, // 10151
|
|
|
|
SID_OUTLINE_LEFT, // 10152
|
|
|
|
SID_OUTLINE_RIGHT, // 10153
|
2013-04-10 08:20:16 +00:00
|
|
|
SID_ATTR_TRANSFORM_PROTECT_POS,// 10236
|
|
|
|
SID_ATTR_TRANSFORM_PROTECT_SIZE,// 10237 //Added
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_FORMTEXT_STYLE, // 10257
|
|
|
|
SID_SET_SUPER_SCRIPT, // 10294
|
|
|
|
SID_SET_SUB_SCRIPT, // 10295
|
2013-04-10 08:20:16 +00:00
|
|
|
SID_ATTR_TRANSFORM_AUTOWIDTH,// 10310
|
|
|
|
SID_ATTR_TRANSFORM_AUTOHEIGHT,// 10311 //Added
|
2000-09-18 16:07:07 +00:00
|
|
|
SID_HYPERLINK_GETLINK, // 10361
|
2009-05-06 10:59:57 +00:00
|
|
|
SID_CHARMAP, // 10503
|
2001-02-07 08:08:30 +00:00
|
|
|
SID_TEXTDIRECTION_LEFT_TO_RIGHT, // 10907
|
|
|
|
SID_TEXTDIRECTION_TOP_TO_BOTTOM, // 10908
|
2002-08-01 10:30:12 +00:00
|
|
|
SID_ATTR_PARA_LEFT_TO_RIGHT, // 10950
|
|
|
|
SID_ATTR_PARA_RIGHT_TO_LEFT, // 10951
|
2000-09-18 16:07:07 +00:00
|
|
|
FN_NUM_BULLET_ON, // 20138
|
|
|
|
SID_PARASPACE_INCREASE, // 27346
|
|
|
|
SID_PARASPACE_DECREASE, // 27347
|
|
|
|
0 };
|
|
|
|
|
|
|
|
TYPEINIT1( FuText, FuConstruct );
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
static bool bTestText = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/**
|
|
|
|
* base class for text functions
|
|
|
|
*/
|
2008-03-12 10:40:54 +00:00
|
|
|
FuText::FuText( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
|
|
|
|
: FuConstruct(pViewSh, pWin, pView, pDoc, rReq)
|
2014-04-24 10:52:02 +02:00
|
|
|
, bFirstObjCreated(false)
|
2011-07-07 09:22:50 +02:00
|
|
|
, bJustEndedEdit(false)
|
2008-03-12 10:40:54 +00:00
|
|
|
, rRequest (rReq)
|
2005-12-14 16:05:19 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> FuText::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
|
2005-12-14 16:05:19 +00:00
|
|
|
{
|
2013-10-25 15:42:11 +02:00
|
|
|
rtl::Reference<FuPoor> xFunc( new FuText( pViewSh, pWin, pView, pDoc, rReq ) );
|
2005-12-14 16:05:19 +00:00
|
|
|
return xFunc;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/** Destruktor */
|
2005-12-14 16:05:19 +00:00
|
|
|
void FuText::disposing()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
if(mpView)
|
2005-12-14 16:05:19 +00:00
|
|
|
{
|
2014-03-10 11:09:59 +02:00
|
|
|
if(mpView->SdrEndTextEdit(false) == SDRENDTEXTEDIT_DELETED)
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( 0 );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// reset the RequestHandler of the used Outliner to the handler of the document
|
2006-12-12 16:25:24 +00:00
|
|
|
::Outliner* pOutliner = mpView->GetTextEditOutliner();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-12-14 16:05:19 +00:00
|
|
|
if (pOutliner)
|
2008-06-06 11:07:42 +00:00
|
|
|
pOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool()));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Execute functionality of this class:
|
|
|
|
|*
|
|
|
|
|* #71422: Start the functionality of this class in this method
|
|
|
|
|* and not in the ctor.
|
|
|
|
|* If you construct an object of this class and you put the
|
|
|
|
|* address of this object to pFuActual you've got a problem,
|
|
|
|
|* because some methods inside DoExecute use the pFuActual-Pointer.
|
|
|
|
|* If the code inside DoExecute is executed inside the ctor,
|
|
|
|
|* the value of pFuActual is not right. And the value will not
|
|
|
|
|* be right until the ctor finished !!!
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2006-12-12 16:25:24 +00:00
|
|
|
void FuText::DoExecute( SfxRequest& )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2007-06-27 14:43:12 +00:00
|
|
|
mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBarShell(
|
2006-03-21 16:19:05 +00:00
|
|
|
ToolBarManager::TBG_FUNCTION,
|
|
|
|
RID_DRAW_TEXT_TOOLBOX);
|
2004-01-20 12:41:53 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_EDIT);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
MouseEvent aMEvt(mpWindow->GetPointerPosPixel());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-10-05 05:51:11 +00:00
|
|
|
if (nSlotId == SID_TEXTEDIT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-10-05 05:51:11 +00:00
|
|
|
// Try to select an object
|
2006-12-12 16:25:24 +00:00
|
|
|
SdrPageView* pPV = mpView->GetSdrPageView();
|
2001-10-05 05:51:11 +00:00
|
|
|
SdrViewEvent aVEvt;
|
2015-04-24 15:55:53 +02:00
|
|
|
mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->MarkObj(aVEvt.pRootObj, pPV);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( dynamic_cast< SdrTextObj* >( aVEvt.pObj ) );
|
2001-10-05 05:51:11 +00:00
|
|
|
}
|
2006-12-12 16:25:24 +00:00
|
|
|
else if (mpView->AreObjectsMarked())
|
2001-10-05 05:51:11 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
2001-10-05 05:51:11 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-07-25 10:42:27 +00:00
|
|
|
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( dynamic_cast< SdrTextObj* >( pObj ) );
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
// check for table
|
|
|
|
if (mpView->AreObjectsMarked())
|
|
|
|
{
|
|
|
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
|
|
|
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
|
|
|
|
if( pObj && (pObj->GetObjInventor() == SdrInventor ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell( ToolBarManager::TBG_FUNCTION, RID_DRAW_TABLE_TOOLBOX );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2001-10-05 05:51:11 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bQuickDrag = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-10-05 05:51:11 +00:00
|
|
|
const SfxItemSet* pArgs = rRequest.GetArgs();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-03-18 14:24:48 +00:00
|
|
|
if (pArgs
|
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
// test for type before using
|
2002-03-18 14:24:48 +00:00
|
|
|
&& SID_TEXTEDIT == nSlotId
|
2014-09-10 17:53:41 +02:00
|
|
|
&& SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT)
|
2002-03-18 14:24:48 +00:00
|
|
|
|
2014-10-29 11:04:25 +02:00
|
|
|
&& (sal_uInt16)static_cast<const SfxUInt16Item&>(pArgs->Get(SID_TEXTEDIT)).GetValue() == 2)
|
2001-10-05 05:51:11 +00:00
|
|
|
{
|
|
|
|
// Selection by doubleclick -> don't allow QuickDrag
|
2014-04-24 10:52:02 +02:00
|
|
|
bQuickDrag = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2001-10-05 05:51:11 +00:00
|
|
|
|
|
|
|
SetInEditMode(aMEvt, bQuickDrag);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bMBDown = true;
|
2013-02-09 14:31:21 +01:00
|
|
|
bJustEndedEdit = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = FuDraw::MouseButtonDown(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-10 11:09:59 +02:00
|
|
|
mpView->SetMarkHdlWhenTextEdit(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
SdrViewEvent aVEvt;
|
2015-04-24 15:55:53 +02:00
|
|
|
SdrHitKind eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (eHit == SDRHIT_TEXTEDIT)
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// hit text -> SdrView handles event
|
2006-12-12 16:25:24 +00:00
|
|
|
if (mpView->MouseButtonDown(rMEvt, mpWindow))
|
2014-04-24 10:52:02 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (rMEvt.GetClicks() == 1)
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
if (mpView->IsTextEdit() && eHit != SDRHIT_MARKEDOBJECT && eHit != SDRHIT_HANDLE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// finish text input
|
2006-12-12 16:25:24 +00:00
|
|
|
if(mpView->SdrEndTextEdit() == SDRENDTEXTEDIT_DELETED)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
/* Bugfix from MBA: during a double click onto the unused? area
|
|
|
|
in text mode, we get with the second click eHit =
|
|
|
|
SDRHIT_TEXTEDITOBJ since it goes to the TextObject which was
|
|
|
|
created with the first click. But this is removed by
|
|
|
|
SdrEndTextEdit since it is empty. But it is still in the mark
|
|
|
|
list. The call MarkObj further below accesses then the dead
|
|
|
|
object. As a simple fix, we determine eHit after
|
|
|
|
SdrEndTextEdit again, this returns then SDRHIT_NONE. */
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( NULL );
|
2015-04-24 15:55:53 +02:00
|
|
|
eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_EDIT);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-05-17 16:22:07 +00:00
|
|
|
if (rMEvt.IsLeft() || rMEvt.IsRight())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
mpWindow->CaptureMouse();
|
|
|
|
SdrPageView* pPV = mpView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (eHit == SDRHIT_TEXTEDIT)
|
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode(rMEvt, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
if (eHit != SDRHIT_HANDLE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// deselect selection
|
|
|
|
if (!rMEvt.IsShift() && eHit == SDRHIT_TEXTEDITOBJ)
|
|
|
|
{
|
|
|
|
mpView->UnmarkAll();
|
|
|
|
mpView->SetDragMode(SDRDRAG_MOVE);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-05-09 10:05:59 +01:00
|
|
|
|
|
|
|
if ( aVEvt.eEvent == SDREVENT_EXECUTEURL ||
|
|
|
|
eHit == SDRHIT_HANDLE ||
|
|
|
|
eHit == SDRHIT_MARKEDOBJECT ||
|
|
|
|
eHit == SDRHIT_TEXTEDITOBJ ||
|
|
|
|
( eHit == SDRHIT_UNMARKEDOBJECT && bFirstObjCreated &&
|
|
|
|
!bPermanent ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// Handle, hit marked or umarked object
|
|
|
|
if (eHit == SDRHIT_TEXTEDITOBJ)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
/* hit text of unmarked object:
|
|
|
|
select object and set to EditMode */
|
|
|
|
mpView->MarkObj(aVEvt.pRootObj, pPV);
|
|
|
|
|
|
|
|
if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
mxTextObj.reset( static_cast<SdrTextObj*>(aVEvt.pObj) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
SetInEditMode(rMEvt, true);
|
|
|
|
}
|
|
|
|
else if (aVEvt.eEvent == SDREVENT_EXECUTEURL && !rMEvt.IsMod2())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// execute URL
|
|
|
|
mpWindow->ReleaseMouse();
|
|
|
|
SfxStringItem aStrItem(SID_FILE_NAME, aVEvt.pURLField->GetURL());
|
|
|
|
SfxStringItem aReferer(SID_REFERER, mpDocSh->GetMedium()->GetName());
|
|
|
|
SfxBoolItem aBrowseItem( SID_BROWSE, true );
|
|
|
|
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
|
|
|
|
mpWindow->ReleaseMouse();
|
|
|
|
|
|
|
|
if (rMEvt.IsMod1())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// open in new frame
|
2014-10-11 16:01:26 +02:00
|
|
|
pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
|
2014-05-09 10:05:59 +01:00
|
|
|
&aStrItem, &aBrowseItem, &aReferer, 0L);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// open in current frame
|
|
|
|
SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
|
2014-10-11 16:01:26 +02:00
|
|
|
pFrame->GetDispatcher()->Execute(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
|
2014-05-09 10:05:59 +01:00
|
|
|
&aStrItem, &aFrameItem, &aBrowseItem, &aReferer, 0L);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// drag object or handle
|
2007-07-18 09:46:11 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
// #i78748#
|
|
|
|
// do the EndTextEdit first, it will delete the handles and force a
|
|
|
|
// recreation. This will make aVEvt.pHdl to point to a deleted handle,
|
|
|
|
// thus it is necessary to reset it and to get it again.
|
2007-07-18 09:46:11 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
// #i112855#
|
|
|
|
// cl: I'm not sure why we checked here also for mxTextObj->GetOutlinerParaObjet
|
|
|
|
// this caused SdrEndTextEdit() to be called also when not in text editing and
|
|
|
|
// this does not make sense and caused troubles. (see issue 112855)
|
2010-07-08 15:42:47 +02:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
if( mpView->IsTextEdit() )
|
|
|
|
{
|
|
|
|
mpView->SdrEndTextEdit();
|
|
|
|
bJustEndedEdit = true;
|
|
|
|
|
|
|
|
if(aVEvt.pHdl)
|
2007-07-18 09:46:11 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
// force new handle identification, the pointer will be dead here
|
|
|
|
// since SdrEndTextEdit has resetted (deleted) the handles.
|
|
|
|
aVEvt.pHdl = 0;
|
2015-04-24 15:55:53 +02:00
|
|
|
mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2007-07-18 09:46:11 +00:00
|
|
|
}
|
2014-05-09 10:05:59 +01:00
|
|
|
}
|
2007-07-18 09:46:11 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
if (!aVEvt.pHdl)
|
|
|
|
{
|
|
|
|
if( eHit == SDRHIT_UNMARKEDOBJECT )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
if ( !rMEvt.IsShift() )
|
|
|
|
mpView->UnmarkAll();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
mpView->MarkObj(aVEvt.pRootObj, pPV);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
// Drag object
|
|
|
|
bFirstMouseMove = true;
|
|
|
|
aDragTimer.Start();
|
|
|
|
}
|
2008-07-30 13:12:14 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
if ( ! rMEvt.IsRight())
|
|
|
|
{
|
|
|
|
// we need to pick again since SdrEndTextEdit can rebuild the handles list
|
2015-04-24 15:55:53 +02:00
|
|
|
eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2014-05-09 10:05:59 +01:00
|
|
|
if( (eHit == SDRHIT_HANDLE) || (eHit == SDRHIT_MARKEDOBJECT) )
|
2008-03-12 10:40:54 +00:00
|
|
|
{
|
2014-05-09 10:05:59 +01:00
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
|
|
|
mpView->BegDragObj(aMDPos, (OutputDevice*) NULL, aVEvt.pHdl, nDrgLog);
|
2008-03-12 10:40:54 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-05-09 10:05:59 +01:00
|
|
|
bReturn = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-05-09 10:05:59 +01:00
|
|
|
}
|
|
|
|
else if ( nSlotId != SID_TEXTEDIT &&
|
|
|
|
(bPermanent || !bFirstObjCreated) )
|
|
|
|
{
|
|
|
|
// create object
|
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_CREATE);
|
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
|
|
|
mpView->BegCreateObj(aMDPos, (OutputDevice*) NULL, nDrgLog);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// select
|
|
|
|
if( !rMEvt.IsShift() )
|
|
|
|
mpView->UnmarkAll();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-05-09 10:05:59 +01:00
|
|
|
mpView->BegMarkObj( aMDPos );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-12-12 16:25:24 +00:00
|
|
|
else if ( rMEvt.GetClicks() == 2 && !mpView->IsTextEdit() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
MouseEvent aMEvt( mpWindow->GetPointerPosPixel() );
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode( aMEvt, false );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!bIsInDragMode)
|
|
|
|
{
|
|
|
|
ForcePointer(&rMEvt);
|
2006-12-12 16:25:24 +00:00
|
|
|
mpViewShell->GetViewFrame()->GetBindings().Invalidate(SidArray);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::MouseMove(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = FuDraw::MouseMove(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (aDragTimer.IsActive() )
|
|
|
|
{
|
|
|
|
if( bFirstMouseMove )
|
2014-04-24 10:52:02 +02:00
|
|
|
bFirstMouseMove = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
aDragTimer.Stop();
|
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if (!bReturn && mpView->IsAction() && !mpDocSh->IsReadOnly())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Point aPix(rMEvt.GetPosPixel());
|
2006-12-12 16:25:24 +00:00
|
|
|
Point aPnt(mpWindow->PixelToLogic(aPix));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
ForceScroll(aPix);
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->MovAction(aPnt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ForcePointer(&rMEvt);
|
|
|
|
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2002-02-15 15:56:24 +00:00
|
|
|
void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
if(mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
|
2002-02-15 15:56:24 +00:00
|
|
|
{
|
|
|
|
if( nSlotId == SID_ATTR_CHAR )
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
/* Create Impress text object (rescales to line height)
|
|
|
|
We get the correct height during the subsequent creation of the
|
|
|
|
object, otherwise we draw to much */
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMinFrameHeightItem(0));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(true));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
pTxtObj->AdjustTextFrameWidthAndHeight();
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMaxFrameHeightItem(pTxtObj->GetLogicRect().GetSize().Height()));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMinFrameWidthItem(0));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(true));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
|
2002-03-04 15:14:07 +00:00
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
// Needs to be set since default is SDRTEXTHORZADJUST_BLOCK
|
2002-03-04 15:14:07 +00:00
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
pTxtObj->AdjustTextFrameWidthAndHeight();
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMaxFrameWidthItem(pTxtObj->GetLogicRect().GetSize().Width()));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( nSlotId == SID_ATTR_CHAR_VERTICAL )
|
|
|
|
{
|
|
|
|
// draw text object, needs to be initialized when vertical text is used
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2002-02-15 15:56:24 +00:00
|
|
|
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(true));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
|
2002-02-15 15:56:24 +00:00
|
|
|
|
2015-02-26 23:02:35 +01:00
|
|
|
// Set defaults for vertical click-n'drag text object, pool defaults are:
|
2003-03-27 09:58:12 +00:00
|
|
|
// SdrTextVertAdjustItem: SDRTEXTVERTADJUST_TOP
|
|
|
|
// SdrTextHorzAdjustItem: SDRTEXTHORZADJUST_BLOCK
|
2011-02-07 22:11:09 +01:00
|
|
|
// Analog to that:
|
2003-03-27 09:58:12 +00:00
|
|
|
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BLOCK));
|
2002-02-15 15:56:24 +00:00
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
|
|
|
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// FitToSize (fit to frame)
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool(), SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
|
2002-02-15 15:56:24 +00:00
|
|
|
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
|
|
|
|
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
pTxtObj->AdjustTextFrameWidthAndHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool(),
|
2002-02-15 15:56:24 +00:00
|
|
|
SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
|
|
|
|
SdrFitToSizeType eFTS = SDRTEXTFIT_PROPORTIONAL;
|
|
|
|
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
pTxtObj->AdjustTextFrameWidthAndHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::ImpSetAttributesFitCommon(SdrTextObj* pTxtObj)
|
|
|
|
{
|
2010-12-05 00:16:48 +02:00
|
|
|
// Normal Textobject
|
2006-12-12 16:25:24 +00:00
|
|
|
if (mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS)
|
2002-02-15 15:56:24 +00:00
|
|
|
{
|
|
|
|
if( nSlotId == SID_ATTR_CHAR )
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// Impress text object (rescales to line height)
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMinFrameHeightItem(0));
|
|
|
|
aSet.Put(makeSdrTextMaxFrameHeightItem(0));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(true));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMinFrameWidthItem(0));
|
|
|
|
aSet.Put(makeSdrTextMaxFrameWidthItem(0));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(true));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
|
2003-11-24 16:16:00 +00:00
|
|
|
pTxtObj->SetMergedItemSet(aSet);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pTxtObj->AdjustTextFrameWidthAndHeight();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = false;
|
2012-11-11 18:25:14 +01:00
|
|
|
SdrObject* pObj;
|
|
|
|
SdrPageView* pPV;
|
2000-09-18 16:07:07 +00:00
|
|
|
if (aDragTimer.IsActive())
|
|
|
|
{
|
|
|
|
aDragTimer.Stop();
|
2014-04-24 10:52:02 +02:00
|
|
|
bIsInDragMode = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 17:01:07 +00:00
|
|
|
if( (mpView && mpView->MouseButtonUp(rMEvt, mpWindow)) || rMEvt.GetClicks() == 2 )
|
2014-04-24 10:52:02 +02:00
|
|
|
return true; // handle event from SdrView
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bEmptyTextObj = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (mxTextObj.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-03-05 16:48:52 +00:00
|
|
|
bool bReset = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-05 16:48:52 +00:00
|
|
|
if (mpView)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-03-05 16:48:52 +00:00
|
|
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1
|
|
|
|
&& ( rMarkList.GetMark(0)->GetMarkedSdrObj() == mxTextObj.get()) )
|
|
|
|
{
|
|
|
|
if( mxTextObj.is() && !GetTextObj()->GetOutlinerParaObject() )
|
2014-04-24 10:52:02 +02:00
|
|
|
bEmptyTextObj = true;
|
2014-03-05 16:48:52 +00:00
|
|
|
else
|
2014-04-24 10:52:02 +02:00
|
|
|
bFirstObjCreated = true;
|
2014-03-05 16:48:52 +00:00
|
|
|
bReset = false;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-03-05 16:48:52 +00:00
|
|
|
|
|
|
|
if (bReset)
|
2008-03-12 10:40:54 +00:00
|
|
|
{
|
|
|
|
mxTextObj.reset( 0 );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if( mpView && mpView->IsDragObj())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// object was moved
|
2006-12-12 16:25:24 +00:00
|
|
|
FrameView* pFrameView = mpViewShell->GetFrameView();
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bDragWithCopy = (rMEvt.IsMod1() && pFrameView->IsDragWithCopy());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (bDragWithCopy)
|
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bDragWithCopy = !mpView->IsPresObjSelected(false, true);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetDragWithCopy(bDragWithCopy);
|
|
|
|
mpView->EndDragObj( mpView->IsDragWithCopy() );
|
|
|
|
mpView->ForceMarkedToAnotherPage();
|
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
2010-12-08 12:35:53 +01:00
|
|
|
|
2011-01-24 17:22:01 +01:00
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
2010-12-08 12:35:53 +01:00
|
|
|
|
2013-02-09 14:31:21 +01:00
|
|
|
if (bJustEndedEdit)
|
|
|
|
{
|
|
|
|
bJustEndedEdit = false;
|
|
|
|
FuPoor::cancel();
|
|
|
|
}
|
|
|
|
if ((rMEvt.GetClicks() != 2) &&
|
2010-12-08 12:35:53 +01:00
|
|
|
!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() &&
|
2013-04-11 00:21:40 -03:00
|
|
|
std::abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
|
|
|
|
std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
|
2010-12-08 12:35:53 +01:00
|
|
|
{
|
2012-11-11 18:25:14 +01:00
|
|
|
/*************************************************************
|
2013-02-09 14:31:21 +01:00
|
|
|
* From text mode, you don't want to rotate immediately.
|
2012-11-11 18:25:14 +01:00
|
|
|
**************************************************************/
|
2015-04-24 13:52:50 +02:00
|
|
|
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
|
2012-11-11 18:25:14 +01:00
|
|
|
{
|
|
|
|
mpView->UnmarkAllObj();
|
|
|
|
mpView->MarkObj(pObj,pPV,false,false);
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2012-11-11 18:25:14 +01:00
|
|
|
}
|
2010-12-08 12:35:53 +01:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-12 16:25:24 +00:00
|
|
|
else if( mpView && mpView->IsCreateObj() && rMEvt.IsLeft())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// object was created
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetCreateObj() ) );
|
|
|
|
|
|
|
|
if( mxTextObj.is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
//AW outliner needs to be set to vertical when there is no
|
|
|
|
// outliner object up to now; also it needs to be set back to not
|
|
|
|
// vertical when there was a vertical one used last time.
|
|
|
|
OutlinerParaObject* pOPO = GetTextObj()->GetOutlinerParaObject();
|
|
|
|
SdrOutliner& rOutl = mxTextObj->GetModel()->GetDrawOutliner(GetTextObj());
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bVertical((pOPO && pOPO->IsVertical())
|
2008-03-12 10:40:54 +00:00
|
|
|
|| nSlotId == SID_ATTR_CHAR_VERTICAL
|
|
|
|
|| nSlotId == SID_TEXT_FITTOSIZE_VERTICAL);
|
|
|
|
rOutl.SetVertical(bVertical);
|
|
|
|
|
2003-03-27 09:58:12 +00:00
|
|
|
// Before ImpSetAttributesForNewTextObject the vertical writing mode
|
|
|
|
// needs to be set at the object. This is done here at the OutlinerParaObject
|
|
|
|
// directly to not mirror the layout text items involved. These items will be set
|
|
|
|
// from ImpSetAttributesForNewTextObject and below.
|
2008-03-12 10:40:54 +00:00
|
|
|
OutlinerParaObject* pPara = GetTextObj()->GetOutlinerParaObject();
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
if(!pPara)
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
GetTextObj()->ForceOutlinerParaObject();
|
|
|
|
pPara = GetTextObj()->GetOutlinerParaObject();
|
2003-03-27 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
CWS-TOOLING: integrate CWS aw063
2009-02-12 13:10:24 +0100 aw r267649 : #i99123# when a primitive is invisible, it is not sufficient to produce no output when decomposing, but to add invisible data using HitTestPrimitive2D. This is needed for the slideshow which relies on geometry data in MetaFiles when painting invisible objects
2009-02-12 13:08:39 +0100 aw r267648 : #i99123# do not ignore HitTestPrimitive2D, but draw empty rectangles instead. This is needed since Slideshow is based on getting MetaFile content when painting invisible objects
2009-02-11 16:04:28 +0100 aw r267620 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:04:10 +0100 aw r267619 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:56 +0100 aw r267618 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:39 +0100 aw r267617 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:03:21 +0100 aw r267615 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:48 +0100 aw r267614 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:24 +0100 aw r267613 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:02:01 +0100 aw r267612 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:32 +0100 aw r267611 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:01:05 +0100 aw r267610 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 16:00:15 +0100 aw r267608 : #i98788# made SfxItemPool destructor protected, added static ::Free method
2009-02-11 11:27:33 +0100 aw r267585 : #i98788# added missing include for STL
2009-02-10 17:46:50 +0100 aw r267570 : #i98788# added reaction on pool destruction
2009-02-10 17:11:58 +0100 aw r267562 : #i98788# added messaging mechanism to register for pool destruction
2009-02-10 13:35:35 +0100 aw r267549 : #i98788# removing changes, too complicated and risky for 3.1
2009-02-10 12:13:48 +0100 aw r267546 : #i98788# 4th round
2009-02-10 12:13:37 +0100 aw r267545 : #i98788# 4th round
2009-02-10 12:13:26 +0100 aw r267544 : #i98788# 4th round
2009-02-10 12:13:14 +0100 aw r267543 : #i98788# 4th round
2009-02-10 12:13:03 +0100 aw r267542 : #i98788# 4th round
2009-02-10 12:12:50 +0100 aw r267541 : #i98788# 4th round
2009-02-10 12:12:37 +0100 aw r267540 : #i98788# 4th round
2009-02-08 14:38:22 +0100 aw r267495 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:38:06 +0100 aw r267494 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:48 +0100 aw r267493 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:37:17 +0100 aw r267492 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:56 +0100 aw r267491 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:44 +0100 aw r267490 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:29 +0100 aw r267489 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:16 +0100 aw r267488 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:36:02 +0100 aw r267487 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-08 14:35:46 +0100 aw r267486 : #i98788# 3rd round of changes to SfxItemPool handling
2009-02-05 12:20:39 +0100 aw r267415 : #i98788# 2nd batch of adaptions for SfxItemPoolHolder addition
2009-02-04 15:12:54 +0100 aw r267385 : #i98788# added newline at EOF
2009-02-04 13:26:04 +0100 aw r267379 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:40 +0100 aw r267378 : #i98788# make SfxItemPool holdable
2009-02-04 13:25:08 +0100 aw r267377 : #i98788# make SfxItemPool holdable
2009-02-04 13:24:42 +0100 aw r267376 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:14 +0100 aw r267375 : #i98788# make SfxItemPool holdable
2009-02-04 13:23:02 +0100 aw r267374 : #i98788# make SfxItemPool holdable
2009-01-29 17:08:31 +0100 aw r267159 : #i97628# completed the fix
2009-01-29 17:08:15 +0100 aw r267158 : #i97628# completed the fix
2009-01-29 14:09:07 +0100 aw r267132 : #i97628# Corrected usage of ParagraphData in headers
2009-01-29 14:06:58 +0100 iha r267131 : #i98344# incorrect font size in charts
2009-01-29 12:13:46 +0100 aw r267115 : #i97628# back to old state; triggers too many errors in other modules
2009-01-29 12:03:51 +0100 aw r267114 : #i97628# enabled exceptions due to STL vector include
2009-01-29 11:21:37 +0100 aw r267107 : #i97628# added needed include
2009-01-28 17:58:29 +0100 aw r267077 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:58:12 +0100 aw r267076 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:51 +0100 aw r267074 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-28 17:57:21 +0100 aw r267073 : #i97628# first version of newly implemented OutlinerParaObject and adaptions
2009-01-27 17:07:33 +0100 aw r267011 : #i98402# added support for ViewRange when exporting MetaFiles in ObjectContactOfPageView::DoProcessDisplay to avoid to paint too much
2009-01-27 11:45:48 +0100 aw r266973 : #i98404# Added a warning to a place where a conversion to rectangle should not be copied from
2009-01-26 21:44:36 +0100 iha r266949 : #i98497# 3D charts are rendered with wrong size
2009-01-26 20:47:07 +0100 aw r266947 : #i98404# handle BackgroundColorPrimitive2D directly in PixelRenderers and avoid AA under all circumstances
2009-01-26 14:50:36 +0100 aw r266926 : #i98386# secured cloning of SdrObject in IMapUserData by boost::shared_prt usage
2009-01-26 12:51:30 +0100 aw r266916 : #i96581# added separated FontStretching and fallback for small X!=Y scale differences
2009-01-23 16:14:55 +0100 aw r266834 : #i96475# added missing implementation of TextDecoratedPortionPrimitive2D::getB2DRange
2009-01-23 15:24:34 +0100 aw r266826 : #i98405# fixed fallback to DrawAlphaRect to use the correctly sized rectangle
2009-01-23 13:34:43 +0100 aw r266813 : #i96474# fixed impSplitSingleWords for an unexpected case
2009-01-23 10:47:31 +0100 aw r266786 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:20 +0100 aw r266785 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:47:09 +0100 aw r266783 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:58 +0100 aw r266782 : #i98289#,#i96474# tooling and new flags for tasks
2009-01-23 10:46:48 +0100 aw r266781 : #i98289#,#i96474# tooling and new flags for tasks
2009-03-04 14:16:02 +00:00
|
|
|
if(pPara && (bool)bVertical != pPara->IsVertical())
|
2003-03-27 09:58:12 +00:00
|
|
|
{
|
|
|
|
// set ParaObject orientation accordingly
|
|
|
|
pPara->SetVertical(bVertical);
|
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
ImpSetAttributesForNewTextObject(GetTextObj());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if (!mpView->EndCreateObj(SDRCREATE_FORCEEND))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// it was not possible to create text object
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else if (nSlotId == SID_TEXT_FITTOSIZE)
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
ImpSetAttributesFitToSize(GetTextObj());
|
2002-02-15 15:56:24 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode(rMEvt, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2001-02-07 08:08:30 +00:00
|
|
|
else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
ImpSetAttributesFitToSizeVertical(GetTextObj());
|
2002-02-15 15:56:24 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode(rMEvt, false);
|
2001-02-07 08:08:30 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
ImpSetAttributesFitCommon(GetTextObj());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// thereby the handles and the gray frame are correct
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->AdjustMarkHdl();
|
|
|
|
mpView->PickHandle(aPnt);
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode(rMEvt, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2006-12-12 16:25:24 +00:00
|
|
|
else if ( mpView && mpView->IsAction())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->EndAction();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ForcePointer(&rMEvt);
|
2006-12-12 16:25:24 +00:00
|
|
|
mpWindow->ReleaseMouse();
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if ( mpView && !mpView->AreObjectsMarked() &&
|
2013-04-11 00:21:40 -03:00
|
|
|
std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 &&
|
|
|
|
std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 &&
|
2000-09-18 16:07:07 +00:00
|
|
|
!rMEvt.IsShift() && !rMEvt.IsMod2() )
|
|
|
|
{
|
2012-11-12 12:30:45 +02:00
|
|
|
SdrPageView* pPV2 = mpView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
SdrViewEvent aVEvt;
|
2015-04-24 15:55:53 +02:00
|
|
|
mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2012-11-12 12:30:45 +02:00
|
|
|
mpView->MarkObj(aVEvt.pRootObj, pPV2);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if ( !mxTextObj.is() && mpView )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if ( ( (!bEmptyTextObj && bPermanent) ||
|
|
|
|
(!bFirstObjCreated && !bPermanent) ) &&
|
2006-12-12 16:25:24 +00:00
|
|
|
!mpDocSh->IsReadOnly() &&
|
2000-09-18 16:07:07 +00:00
|
|
|
nSlotId != SID_TEXTEDIT )
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// text body (left-justified AutoGrow)
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_CREATE);
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->BegCreateObj(aMDPos, (OutputDevice*) NULL, nDrgLog);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bSnapEnabled = mpView->IsSnapEnabled();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (bSnapEnabled)
|
2014-03-10 11:09:59 +02:00
|
|
|
mpView->SetSnapEnabled(false);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
aPnt.X() += nDrgLog + nDrgLog;
|
|
|
|
aPnt.Y() += nDrgLog + nDrgLog;
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->MovAction(aPnt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetCreateObj() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(mxTextObj.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-28 20:00:21 +01:00
|
|
|
GetTextObj()->SetDisableAutoWidthOnDragging(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(!mpView->EndCreateObj(SDRCREATE_FORCEEND))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(bSnapEnabled)
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetSnapEnabled(bSnapEnabled);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(mxTextObj.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
SfxItemSet aSet(mpViewShell->GetPool());
|
2014-07-31 15:57:12 +02:00
|
|
|
aSet.Put(makeSdrTextMinFrameHeightItem(0));
|
|
|
|
aSet.Put(makeSdrTextMinFrameWidthItem(0));
|
2014-08-04 19:22:55 +02:00
|
|
|
aSet.Put(makeSdrTextAutoGrowHeightItem(true));
|
|
|
|
aSet.Put(makeSdrTextAutoGrowWidthItem(true));
|
2001-08-24 14:46:48 +00:00
|
|
|
|
|
|
|
if(nSlotId == SID_ATTR_CHAR_VERTICAL)
|
|
|
|
{
|
2003-03-27 09:58:12 +00:00
|
|
|
// Here, all items which need to be different from pool default need to be set
|
|
|
|
// again on the newly created text object.
|
2015-02-26 23:02:35 +01:00
|
|
|
// Since this is a simple click text object, it is first created, then SetVertical()
|
2003-03-27 09:58:12 +00:00
|
|
|
// is used, then ImpSetAttributesForNewTextObject is called and then the object is
|
|
|
|
// deleted again since not the minimum drag distance was travelled. Then, a new
|
2015-02-26 23:02:35 +01:00
|
|
|
// click text object is created and thus all that stuff needs to be set again here.
|
2014-02-25 23:45:44 +01:00
|
|
|
|
2003-03-27 09:58:12 +00:00
|
|
|
// Before using the new object the vertical writing mode
|
|
|
|
// needs to be set. This is done here at the OutlinerParaObject
|
|
|
|
// directly to not mirror the layout text items involved. These items will be set
|
|
|
|
// below.
|
2008-03-12 10:40:54 +00:00
|
|
|
OutlinerParaObject* pPara = GetTextObj()->GetOutlinerParaObject();
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
if(!pPara)
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
GetTextObj()->ForceOutlinerParaObject();
|
|
|
|
pPara = GetTextObj()->GetOutlinerParaObject();
|
2003-03-27 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2014-01-22 00:57:35 +01:00
|
|
|
if(pPara && !pPara->IsVertical())
|
2003-03-27 09:58:12 +00:00
|
|
|
{
|
|
|
|
// set ParaObject orientation accordingly
|
2014-01-28 20:00:21 +01:00
|
|
|
pPara->SetVertical(true);
|
2003-03-27 09:58:12 +00:00
|
|
|
}
|
|
|
|
|
2001-08-24 14:46:48 +00:00
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
// Analog to the else case below, for vertical simple click texts
|
|
|
|
// one of the defaulted setted items from ImpSetAttributesForNewTextObject
|
2011-02-07 22:11:09 +01:00
|
|
|
// needs to be adapted to non-block mode.
|
2006-12-12 16:25:24 +00:00
|
|
|
const SfxItemSet& rSet = mpView->GetDefaultAttr();
|
2014-10-29 11:04:25 +02:00
|
|
|
SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue();
|
2003-03-27 09:58:12 +00:00
|
|
|
|
|
|
|
if(FRMDIR_HORI_RIGHT_TOP == eDirection || FRMDIR_VERT_TOP_RIGHT == eDirection)
|
|
|
|
{
|
|
|
|
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BOTTOM));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP));
|
|
|
|
}
|
2001-08-24 14:46:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-05 00:16:48 +02:00
|
|
|
// This is for Format/Page settings. Since this also leads
|
2002-11-15 13:46:44 +00:00
|
|
|
// to the object defaults to be changed, i think this code can be
|
|
|
|
// removed. CL. wanted to take a look before adding this.
|
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
// Look in the object defaults if left-to-right is wanted. If
|
2002-11-15 13:46:44 +00:00
|
|
|
// yes, set text anchoring to right to let the box grow to left.
|
2006-12-12 16:25:24 +00:00
|
|
|
const SfxItemSet& rSet = mpView->GetDefaultAttr();
|
2014-10-29 11:04:25 +02:00
|
|
|
SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue();
|
2002-11-15 13:46:44 +00:00
|
|
|
|
|
|
|
if(FRMDIR_HORI_RIGHT_TOP == eDirection)
|
|
|
|
{
|
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT));
|
|
|
|
}
|
2001-08-24 14:46:48 +00:00
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
GetTextObj()->SetMergedItemSet(aSet);
|
2014-01-28 20:00:21 +01:00
|
|
|
GetTextObj()->SetDisableAutoWidthOnDragging(true);
|
2014-04-24 10:52:02 +02:00
|
|
|
SetInEditMode(rMEvt, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bFirstObjCreated = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// switch to selection
|
2006-12-12 16:25:24 +00:00
|
|
|
if (mpView->SdrEndTextEdit() == SDRENDTEXTEDIT_DELETED)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_SELECT,
|
2014-10-11 16:01:26 +02:00
|
|
|
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2013-02-09 14:31:21 +01:00
|
|
|
if (bJustEndedEdit)
|
|
|
|
{
|
|
|
|
bJustEndedEdit = false;
|
|
|
|
FuPoor::cancel();
|
|
|
|
}
|
2014-04-24 10:52:02 +02:00
|
|
|
bMBDown = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
FuConstruct::MouseButtonUp(rMEvt);
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/**
|
|
|
|
* handle keyboard events
|
|
|
|
* @returns sal_True if the event was handled, sal_False otherwise
|
|
|
|
*/
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::KeyInput(const KeyEvent& rKEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = false;
|
2014-03-10 11:09:59 +02:00
|
|
|
mpView->SetMarkHdlWhenTextEdit(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-08-23 22:22:32 +03:00
|
|
|
vcl::KeyCode nCode = rKEvt.GetKeyCode();
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bShift = nCode.IsShift();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(mxTextObj.is())
|
2002-03-14 16:44:36 +00:00
|
|
|
{
|
|
|
|
// maybe object is deleted, test if it's equal to the selected object
|
2006-12-12 16:25:24 +00:00
|
|
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
2002-03-14 16:44:36 +00:00
|
|
|
SdrObject* pSelectedObj = 0L;
|
|
|
|
|
|
|
|
if(1 == rMarkList.GetMarkCount())
|
|
|
|
{
|
|
|
|
SdrMark* pMark = rMarkList.GetMark(0);
|
2006-07-25 10:42:27 +00:00
|
|
|
pSelectedObj = pMark->GetMarkedSdrObj();
|
2002-03-14 16:44:36 +00:00
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if(mxTextObj.get() != pSelectedObj)
|
2002-03-14 16:44:36 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2002-03-14 16:44:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if ( mxTextObj.is() && mxTextObj->GetObjInventor() == SdrInventor && mxTextObj->GetObjIdentifier() == OBJ_TITLETEXT && rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// title text object: always soft breaks
|
2014-04-24 10:52:02 +02:00
|
|
|
bShift = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nKey = nCode.GetCode();
|
2014-08-23 22:22:32 +03:00
|
|
|
vcl::KeyCode aKeyCode (nKey, bShift, nCode.IsMod1(), nCode.IsMod2(), nCode.IsMod3() );
|
2000-09-18 16:07:07 +00:00
|
|
|
KeyEvent aKEvt(rKEvt.GetCharCode(), aKeyCode);
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bOK = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if (mpDocSh->IsReadOnly())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
bOK = !EditEngine::DoesKeyChangeText(aKEvt);
|
|
|
|
}
|
|
|
|
if( aKeyCode.GetCode() == KEY_PAGEUP || aKeyCode.GetCode() == KEY_PAGEDOWN )
|
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bOK = false; // default handling in base class
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
if (bOK && mpView->KeyInput(aKEvt, mpWindow) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bReturn = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else if (aKeyCode == KEY_ESCAPE)
|
|
|
|
{
|
2002-11-29 13:23:07 +00:00
|
|
|
bReturn = cancel();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if( bPermanent )
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_CREATE);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!bReturn)
|
|
|
|
{
|
|
|
|
bReturn = FuDraw::KeyInput(aKEvt);
|
|
|
|
}
|
|
|
|
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::Activate()
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetQuickTextEditMode(mpViewShell->GetFrameView()->IsQuickEdit());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-11-19 14:05:59 +00:00
|
|
|
// #i89661# it's no longer necessary to make it so big here, it's fine tuned
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
// for text objects in SdrMarkView::CheckSingleSdrObjectHit
|
2008-11-19 14:05:59 +00:00
|
|
|
mpView->SetHitTolerancePixel( 2 * HITPIX );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pOLV)
|
|
|
|
pOLV->ShowCursor();
|
|
|
|
|
|
|
|
FuConstruct::Activate();
|
|
|
|
|
|
|
|
if( pOLV )
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetEditMode(SDREDITMODE_EDIT);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::Deactivate()
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pOLV)
|
|
|
|
pOLV->HideCursor();
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetHitTolerancePixel( HITPIX );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
FuConstruct::Deactivate();
|
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/**
|
|
|
|
* Sets the object into the edit mode.
|
|
|
|
*/
|
2014-04-24 10:52:02 +02:00
|
|
|
void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
SdrPageView* pPV = mpView->GetSdrPageView();
|
2008-03-12 10:40:54 +00:00
|
|
|
if( mxTextObj.is() && (mxTextObj->GetPage() == pPV->GetPage()) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if( bPermanent )
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetEditMode(SDREDITMODE_CREATE);
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetEditMode(SDREDITMODE_EDIT);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bEmptyOutliner = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (!GetTextObj()->GetOutlinerParaObject() && mpView->GetTextEditOutliner())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
::Outliner* pOutl = mpView->GetTextEditOutliner();
|
2013-05-08 18:12:32 +02:00
|
|
|
sal_Int32 nParaAnz = pOutl->GetParagraphCount();
|
2000-09-18 16:07:07 +00:00
|
|
|
Paragraph* p1stPara = pOutl->GetParagraph( 0 );
|
|
|
|
|
|
|
|
if (nParaAnz==1 && p1stPara)
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// with only one paragraph
|
2013-08-14 13:44:38 +01:00
|
|
|
if (pOutl->GetText(p1stPara).isEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bEmptyOutliner = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (GetTextObj() != mpView->GetTextEditObject() || bEmptyOutliner)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt32 nInv = mxTextObj->GetObjInventor();
|
|
|
|
sal_uInt16 nSdrObjKind = mxTextObj->GetObjIdentifier();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (nInv == SdrInventor && GetTextObj()->HasTextEdit() &&
|
2000-09-18 16:07:07 +00:00
|
|
|
(nSdrObjKind == OBJ_TEXT ||
|
|
|
|
nSdrObjKind == OBJ_TITLETEXT ||
|
2008-03-12 10:40:54 +00:00
|
|
|
nSdrObjKind == OBJ_OUTLINETEXT || !mxTextObj->IsEmptyPresObj() ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// create new outliner (owned by SdrObjEditView)
|
2014-10-29 09:08:21 +00:00
|
|
|
SdrOutliner* pOutl = SdrMakeOutliner(OUTLINERMODE_OUTLINEOBJECT, *mpDoc);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (bEmptyOutliner)
|
2014-03-10 11:09:59 +02:00
|
|
|
mpView->SdrEndTextEdit(true);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
SdrTextObj* pTextObj = GetTextObj();
|
2004-03-17 10:27:58 +00:00
|
|
|
if( pTextObj )
|
|
|
|
{
|
|
|
|
OutlinerParaObject* pOPO = pTextObj->GetOutlinerParaObject();
|
2008-03-12 10:40:54 +00:00
|
|
|
if( ( pOPO && pOPO->IsVertical() ) || (nSlotId == SID_ATTR_CHAR_VERTICAL) || (nSlotId == SID_TEXT_FITTOSIZE_VERTICAL) )
|
2014-02-25 14:19:24 +02:00
|
|
|
pOutl->SetVertical( true );
|
2001-02-05 10:35:37 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if( pTextObj->getTextCount() > 1 )
|
|
|
|
{
|
|
|
|
Point aPix(rMEvt.GetPosPixel());
|
|
|
|
Point aPnt(mpWindow->PixelToLogic(aPix));
|
|
|
|
pTextObj->setActiveText( pTextObj->CheckTextHit(aPnt ) );
|
|
|
|
}
|
2001-02-05 10:35:37 +00:00
|
|
|
|
2014-03-10 11:09:59 +02:00
|
|
|
if (mpView->SdrBeginTextEdit(pTextObj, pPV, mpWindow, true, pOutl) && mxTextObj->GetObjInventor() == SdrInventor)
|
2004-03-17 10:27:58 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bFirstObjCreated = true;
|
2004-03-17 10:27:58 +00:00
|
|
|
DeleteDefaultText();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
nSdrObjKind = mxTextObj->GetObjIdentifier();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-03-17 10:27:58 +00:00
|
|
|
SdrViewEvent aVEvt;
|
2015-04-24 15:55:53 +02:00
|
|
|
SdrHitKind eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-03-17 10:27:58 +00:00
|
|
|
if (eHit == SDRHIT_TEXTEDIT)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// hit text
|
2004-03-17 10:27:58 +00:00
|
|
|
if (nSdrObjKind == OBJ_TEXT ||
|
|
|
|
nSdrObjKind == OBJ_TITLETEXT ||
|
|
|
|
nSdrObjKind == OBJ_OUTLINETEXT ||
|
2008-03-12 10:40:54 +00:00
|
|
|
nSdrObjKind == OBJ_TABLE ||
|
2004-03-17 10:27:58 +00:00
|
|
|
nSlotId == SID_TEXTEDIT ||
|
|
|
|
!bQuickDrag)
|
|
|
|
{
|
|
|
|
pOLV->MouseButtonDown(rMEvt);
|
|
|
|
pOLV->MouseMove(rMEvt);
|
|
|
|
pOLV->MouseButtonUp(rMEvt);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (mpViewShell->GetFrameView()->IsQuickEdit() && bQuickDrag && GetTextObj()->GetOutlinerParaObject())
|
2004-03-17 10:27:58 +00:00
|
|
|
{
|
|
|
|
pOLV->MouseButtonDown(rMEvt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-12-05 00:16:48 +02:00
|
|
|
// Move cursor to end of text
|
2004-03-17 10:27:58 +00:00
|
|
|
ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
|
2013-04-10 08:20:16 +00:00
|
|
|
if (pOLV != NULL)
|
|
|
|
pOLV->SetSelection(aNewSelection);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2002-03-18 14:24:48 +00:00
|
|
|
else
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mpView->RestoreDefaultText(dynamic_cast< SdrTextObj* >( mxTextObj.get() ));
|
2002-03-18 14:24:48 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/**
|
|
|
|
* Text entry is started, if necessary delete the default text.
|
|
|
|
*/
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::DeleteDefaultText()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bDeleted = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if ( mxTextObj.is() && mxTextObj->IsEmptyPresObj() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-10-29 11:04:25 +02:00
|
|
|
SdPage* pPage = static_cast<SdPage*>( mxTextObj->GetPage() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pPage)
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
PresObjKind ePresObjKind = pPage->GetPresObjKind(mxTextObj.get());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ( (ePresObjKind == PRESOBJ_TITLE ||
|
|
|
|
ePresObjKind == PRESOBJ_OUTLINE ||
|
|
|
|
ePresObjKind == PRESOBJ_NOTES ||
|
|
|
|
ePresObjKind == PRESOBJ_TEXT) &&
|
|
|
|
!pPage->IsMasterPage() )
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
::Outliner* pOutliner = mpView->GetTextEditOutliner();
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxStyleSheet* pSheet = pOutliner->GetStyleSheet( 0 );
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bIsUndoEnabled = pOutliner->IsUndoEnabled();
|
2005-02-17 08:41:49 +00:00
|
|
|
if( bIsUndoEnabled )
|
2014-02-25 14:19:24 +02:00
|
|
|
pOutliner->EnableUndo(false);
|
2005-02-17 08:41:49 +00:00
|
|
|
|
2013-08-24 22:22:45 +04:00
|
|
|
pOutliner->SetText( OUString(), pOutliner->GetParagraph( 0 ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2005-02-17 08:41:49 +00:00
|
|
|
if( bIsUndoEnabled )
|
2014-02-25 14:19:24 +02:00
|
|
|
pOutliner->EnableUndo(true);
|
2005-02-17 08:41:49 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if (pSheet &&
|
|
|
|
(ePresObjKind == PRESOBJ_NOTES || ePresObjKind == PRESOBJ_TEXT))
|
|
|
|
pOutliner->SetStyleSheet(0, pSheet);
|
|
|
|
|
2014-01-28 20:00:21 +01:00
|
|
|
mxTextObj->SetEmptyPresObj(true);
|
2014-04-24 10:52:02 +02:00
|
|
|
bDeleted = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-11 13:20:49 +02:00
|
|
|
return bDeleted;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::Command(const CommandEvent& rCEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
return FuPoor::Command(rCEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuText::RequestHelp(const HelpEvent& rHEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ((Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled()) &&
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.is() && pOLV && pOLV->GetFieldUnderMousePointer())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-08-24 22:22:45 +04:00
|
|
|
OUString aHelpText;
|
2000-09-18 16:07:07 +00:00
|
|
|
const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
|
|
|
|
const SvxFieldData* pField = pFieldItem->GetField();
|
|
|
|
|
|
|
|
if (pField && pField->ISA(SvxURLField))
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// URL-Field
|
2015-04-07 20:21:21 +02:00
|
|
|
aHelpText = INetURLObject::decode( static_cast<const SvxURLField*>(pField)->GetURL(), INetURLObject::DECODE_WITH_CHARSET );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2013-08-24 22:22:45 +04:00
|
|
|
if (!aHelpText.isEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
Rectangle aLogicPix = mpWindow->LogicToPixel(mxTextObj->GetLogicRect());
|
2006-12-12 16:25:24 +00:00
|
|
|
Rectangle aScreenRect(mpWindow->OutputToScreenPixel(aLogicPix.TopLeft()),
|
|
|
|
mpWindow->OutputToScreenPixel(aLogicPix.BottomRight()));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (Help::IsBalloonHelpEnabled())
|
|
|
|
{
|
2014-09-23 11:20:40 +02:00
|
|
|
bReturn = Help::ShowBalloon( (vcl::Window*)mpWindow, rHEvt.GetMousePosPixel(), aScreenRect, aHelpText);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else if (Help::IsQuickHelpEnabled())
|
|
|
|
{
|
2014-09-23 11:20:40 +02:00
|
|
|
bReturn = Help::ShowQuickHelp( (vcl::Window*)mpWindow, aScreenRect, aHelpText);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bReturn)
|
|
|
|
{
|
|
|
|
bReturn = FuConstruct::RequestHelp(rHEvt);
|
|
|
|
}
|
|
|
|
|
2015-02-11 13:20:49 +02:00
|
|
|
return bReturn;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FuText::ReceiveRequest(SfxRequest& rReq)
|
|
|
|
{
|
|
|
|
nSlotId = rReq.GetSlot();
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
// then we call the base class (besides others, nSlotId is NOT set there)
|
2000-09-18 16:07:07 +00:00
|
|
|
FuPoor::ReceiveRequest(rReq);
|
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
if (nSlotId == SID_TEXTEDIT || mpViewShell->GetFrameView()->IsQuickEdit() || SID_ATTR_CHAR == nSlotId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
MouseEvent aMEvt(mpWindow->GetPointerPosPixel());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (nSlotId == SID_TEXTEDIT)
|
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// are we currently editing?
|
2000-09-18 16:07:07 +00:00
|
|
|
if(!bTestText)
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetTextEditObject() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2008-03-12 10:40:54 +00:00
|
|
|
if (!mxTextObj.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-12-05 00:16:48 +02:00
|
|
|
// Try to select an object
|
2006-12-12 16:25:24 +00:00
|
|
|
SdrPageView* pPV = mpView->GetSdrPageView();
|
2000-09-18 16:07:07 +00:00
|
|
|
SdrViewEvent aVEvt;
|
2015-04-24 15:55:53 +02:00
|
|
|
mpView->PickAnything(aMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->MarkObj(aVEvt.pRootObj, pPV);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (aVEvt.pObj && aVEvt.pObj->ISA(SdrTextObj))
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( static_cast< SdrTextObj* >( aVEvt.pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-12-12 16:25:24 +00:00
|
|
|
else if (mpView->AreObjectsMarked())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (rMarkList.GetMarkCount() == 1)
|
|
|
|
{
|
2006-07-25 10:42:27 +00:00
|
|
|
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (pObj->ISA(SdrTextObj))
|
|
|
|
{
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset( static_cast< SdrTextObj* >( pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bQuickDrag = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
2002-03-18 14:24:48 +00:00
|
|
|
if (pArgs
|
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
// test for type before using
|
2002-03-18 14:24:48 +00:00
|
|
|
&& SID_TEXTEDIT == nSlotId
|
2014-09-10 17:53:41 +02:00
|
|
|
&& SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT)
|
2002-03-18 14:24:48 +00:00
|
|
|
|
2014-10-29 11:04:25 +02:00
|
|
|
&& (sal_uInt16) static_cast<const SfxUInt16Item&>( pArgs->Get(SID_TEXTEDIT)).GetValue() == 2)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// selection wit double click -> do not allow QuickDrag
|
2014-04-24 10:52:02 +02:00
|
|
|
bQuickDrag = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SetInEditMode(aMEvt, bQuickDrag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
void FuText::DoubleClick(const MouseEvent& )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-12-05 00:16:48 +02:00
|
|
|
// Nothing to do
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 00:16:48 +02:00
|
|
|
/** Removed the insertion of default text and putting a new text
|
2002-12-03 13:57:19 +00:00
|
|
|
object directly into edit mode.
|
|
|
|
*/
|
2002-02-15 15:56:24 +00:00
|
|
|
SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
|
|
|
|
{
|
|
|
|
|
|
|
|
SdrObject* pObj = SdrObjFactory::MakeNewObject(
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
|
|
|
|
0L, mpDoc);
|
2002-02-15 15:56:24 +00:00
|
|
|
|
|
|
|
if(pObj)
|
|
|
|
{
|
|
|
|
if(pObj->ISA(SdrTextObj))
|
|
|
|
{
|
2014-10-29 11:04:25 +02:00
|
|
|
SdrTextObj* pText = static_cast<SdrTextObj*>(pObj);
|
2002-02-15 15:56:24 +00:00
|
|
|
pText->SetLogicRect(rRectangle);
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
|
2002-02-15 15:56:24 +00:00
|
|
|
pText->SetVerticalWriting(bVertical);
|
|
|
|
|
|
|
|
ImpSetAttributesForNewTextObject(pText);
|
|
|
|
|
|
|
|
if (nSlotId == SID_TEXT_FITTOSIZE)
|
|
|
|
{
|
|
|
|
ImpSetAttributesFitToSize(pText);
|
|
|
|
}
|
|
|
|
else if ( nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
|
|
|
|
{
|
|
|
|
ImpSetAttributesFitToSizeVertical(pText);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ImpSetAttributesFitCommon(pText);
|
|
|
|
}
|
2002-12-03 13:57:19 +00:00
|
|
|
|
|
|
|
// Put text object into edit mode.
|
2006-12-12 16:25:24 +00:00
|
|
|
SdrPageView* pPV = mpView->GetSdrPageView();
|
2008-03-12 10:40:54 +00:00
|
|
|
mpView->SdrBeginTextEdit(pText, pPV);
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-01 19:06:55 +01:00
|
|
|
OSL_FAIL("Object is NO text object");
|
2002-02-15 15:56:24 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2002-02-15 15:56:24 +00:00
|
|
|
return pObj;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-10 10:54:35 +02:00
|
|
|
/** is called when the current function should be aborted. <p>
|
2002-11-29 13:23:07 +00:00
|
|
|
This is used when a function gets a KEY_ESCAPE but can also
|
|
|
|
be called directly.
|
|
|
|
|
|
|
|
@returns true if a active function was aborted
|
|
|
|
*/
|
|
|
|
bool FuText::cancel()
|
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
if ( mpView->IsTextEdit() )
|
2002-11-29 13:23:07 +00:00
|
|
|
{
|
2006-12-12 16:25:24 +00:00
|
|
|
if(mpView->SdrEndTextEdit() == SDRENDTEXTEDIT_DELETED)
|
2008-03-12 10:40:54 +00:00
|
|
|
mxTextObj.reset(0);
|
2002-11-29 13:23:07 +00:00
|
|
|
|
2006-12-12 16:25:24 +00:00
|
|
|
mpView->SetCurrentObj(OBJ_TEXT);
|
|
|
|
mpView->SetEditMode(SDREDITMODE_EDIT);
|
2002-11-29 13:23:07 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2003-12-01 10:51:18 +00:00
|
|
|
|
2008-12-11 15:25:59 +00:00
|
|
|
void FuText::ChangeFontSize( bool bGrow, OutlinerView* pOLV, const FontList* pFontList, ::sd::View* pView )
|
|
|
|
{
|
|
|
|
if( !pFontList || !pView )
|
|
|
|
return;
|
|
|
|
|
|
|
|
if( pOLV )
|
|
|
|
{
|
|
|
|
pOLV->GetEditView().ChangeFontSize( bGrow, pFontList );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
|
2014-08-05 22:30:24 +02:00
|
|
|
for( size_t nMark = 0; nMark < rMarkList.GetMarkCount(); ++nMark )
|
2008-12-11 15:25:59 +00:00
|
|
|
{
|
|
|
|
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( rMarkList.GetMark(nMark)->GetMarkedSdrObj() );
|
|
|
|
if( pTextObj )
|
|
|
|
{
|
|
|
|
for( sal_Int32 nText = 0; nText < pTextObj->getTextCount(); nText++ )
|
|
|
|
{
|
|
|
|
pTextObj->setActiveText( nText );
|
|
|
|
|
|
|
|
// Put text object into edit mode.
|
|
|
|
SdrPageView* pPV = pView->GetSdrPageView();
|
|
|
|
pView->SdrBeginTextEdit(pTextObj, pPV);
|
|
|
|
|
|
|
|
pOLV = pView->GetTextEditOutlinerView();
|
|
|
|
if( pOLV )
|
|
|
|
{
|
|
|
|
EditEngine* pEditEngine = pOLV->GetEditView().GetEditEngine();
|
|
|
|
if( pEditEngine )
|
|
|
|
{
|
|
|
|
ESelection aSel;
|
|
|
|
aSel.nEndPara = pEditEngine->GetParagraphCount()-1;
|
|
|
|
aSel.nEndPos = pEditEngine->GetTextLen(aSel.nEndPara);
|
|
|
|
pOLV->SetSelection(aSel);
|
|
|
|
}
|
|
|
|
|
|
|
|
ChangeFontSize( bGrow, pOLV, pFontList, pView );
|
|
|
|
}
|
|
|
|
|
|
|
|
pView->SdrEndTextEdit();
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemSet aShapeSet( pTextObj->GetMergedItemSet() );
|
|
|
|
if( EditView::ChangeFontSize( bGrow, aShapeSet, pFontList ) )
|
|
|
|
{
|
|
|
|
pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT ) );
|
|
|
|
pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT_CJK ) );
|
|
|
|
pTextObj->SetObjectItemNoBroadcast( aShapeSet.Get( EE_CHAR_FONTHEIGHT_CTL ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 12:41:53 +00:00
|
|
|
} // end of namespace sd
|
|
|
|
|
2010-10-12 15:51:52 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|