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
|
|
|
|
2017-10-23 22:32:55 +02:00
|
|
|
#include <fuconstr.hxx>
|
2004-01-20 09:59:25 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <svx/svdpagv.hxx>
|
|
|
|
#include <svx/xdef.hxx>
|
|
|
|
#include <svx/xfillit0.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
2019-05-01 22:12:48 +02:00
|
|
|
#include <tools/debug.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2017-10-23 22:32:55 +02:00
|
|
|
#include <app.hrc>
|
|
|
|
#include <strings.hrc>
|
|
|
|
#include <strings.hxx>
|
|
|
|
#include <fudraw.hxx>
|
|
|
|
#include <View.hxx>
|
|
|
|
#include <Window.hxx>
|
|
|
|
#include <ViewShell.hxx>
|
|
|
|
#include <drawdoc.hxx>
|
|
|
|
#include <FrameView.hxx>
|
|
|
|
#include <sdpage.hxx>
|
|
|
|
#include <sdresid.hxx>
|
2018-09-06 00:36:41 +02:00
|
|
|
#include <glob.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-07-18 18:07:36 +02:00
|
|
|
using namespace com::sun::star;
|
|
|
|
|
2004-01-20 09:59:25 +00:00
|
|
|
namespace sd {
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-20 09:59:25 +00:00
|
|
|
FuConstruct::FuConstruct (
|
|
|
|
ViewShell* pViewSh,
|
|
|
|
::sd::Window* pWin,
|
|
|
|
::sd::View* pView,
|
|
|
|
SdDrawDocument* pDoc,
|
|
|
|
SfxRequest& rReq)
|
|
|
|
: FuDraw(pViewSh, pWin, pView, pDoc, rReq),
|
2014-01-28 20:00:21 +01:00
|
|
|
bSelectionChanged(false)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt)
|
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-04-24 10:52:02 +02:00
|
|
|
bMBDown = true;
|
2014-01-28 20:00:21 +01:00
|
|
|
bSelectionChanged = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if ( mpView->IsAction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bFirstMouseMove = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
aDragTimer.Start();
|
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nHitLog = sal_uInt16 (mpWindow->PixelToLogic(Size(HITPIX,0)).Width());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if (rMEvt.IsLeft() && mpView->IsExtendedMouseEventDispatcherEnabled())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
mpWindow->CaptureMouse();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
SdrHdl* pHdl = mpView->PickHandle(aMDPos);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-11-10 10:23:02 +01:00
|
|
|
if ( pHdl != nullptr || mpView->IsMarkedHit(aMDPos, nHitLog) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
2015-06-08 16:27:49 +02:00
|
|
|
mpView->BegDragObj(aMDPos, nullptr, pHdl, nDrgLog);
|
2014-04-24 10:52:02 +02:00
|
|
|
bReturn = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-12 16:16:11 +00:00
|
|
|
else if ( mpView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
mpView->UnmarkAll();
|
2014-04-24 10:52:02 +02:00
|
|
|
bReturn = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
FuDraw::MouseMove(rMEvt);
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
Point aPix(rMEvt.GetPosPixel());
|
2006-12-12 16:16:11 +00:00
|
|
|
Point aPnt( mpWindow->PixelToLogic(aPix) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if ( mpView->IsAction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ForceScroll(aPix);
|
2006-12-12 16:16:11 +00:00
|
|
|
mpView->MovAction(aPnt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 10:52:02 +02:00
|
|
|
bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bReturn = true;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
FuDraw::MouseButtonUp(rMEvt);
|
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if ( mpView && mpView->IsDragObj() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +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)
|
|
|
|
{
|
2015-10-19 17:51:00 +02:00
|
|
|
bDragWithCopy = !mpView->IsPresObjSelected(false);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
mpView->SetDragWithCopy(bDragWithCopy);
|
|
|
|
mpView->EndDragObj( mpView->IsDragWithCopy() );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2006-12-12 16:16:11 +00:00
|
|
|
else if ( mpView && mpView->IsMarkObj() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
mpView->EndMarkObj();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bReturn = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if ( mpView && !mpView->IsAction() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
mpWindow->ReleaseMouse();
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-12-12 16:16:11 +00:00
|
|
|
if ( !mpView->AreObjectsMarked() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
SdrPageView* pPV;
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nHitLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(HITPIX,0)).Width() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-11-12 17:07:22 +00:00
|
|
|
SdrObject* pObj = mpView->PickObj(aPnt, mpView->getHitTolLog(), pPV);
|
|
|
|
if (!pObj)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
mpView->MarkObj(aPnt, nHitLog);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-10-11 16:01:26 +02:00
|
|
|
mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else if (rMEvt.IsLeft() && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() &&
|
|
|
|
!bSelectionChanged &&
|
2013-04-11 00:21:40 -03:00
|
|
|
std::abs(aPnt.X() - aMDPos.X()) < nDrgLog &&
|
|
|
|
std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-03-12 20:27:21 +01:00
|
|
|
// toggle between selection and rotation
|
2015-11-10 10:23:02 +01:00
|
|
|
SdrObject* pSingleObj = nullptr;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-08-05 22:30:24 +02:00
|
|
|
if (mpView->GetMarkedObjectList().GetMarkCount()==1)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2006-12-12 16:16:11 +00:00
|
|
|
pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2016-08-18 12:20:08 +02:00
|
|
|
if (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() &&
|
2006-12-12 16:16:11 +00:00
|
|
|
(mpViewShell->GetFrameView()->IsClickChangeRotation() ||
|
2016-11-21 11:45:50 +02:00
|
|
|
(pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d)))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-08-18 12:20:08 +02:00
|
|
|
mpView->SetDragMode(SdrDragMode::Rotate);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-08-18 12:20:08 +02:00
|
|
|
mpView->SetDragMode(SdrDragMode::Move);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 11:41:00 +01:00
|
|
|
sal_uInt16 nClicks = rMEvt.GetClicks();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if (nClicks == 2 && rMEvt.IsLeft() && bMBDown &&
|
|
|
|
!rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsShift() )
|
|
|
|
{
|
|
|
|
DoubleClick(rMEvt);
|
|
|
|
}
|
2014-04-24 10:52:02 +02:00
|
|
|
bMBDown = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return bReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuConstruct::Activate()
|
|
|
|
{
|
2016-08-19 14:31:46 +02:00
|
|
|
mpView->SetEditMode(SdrViewEditMode::Create);
|
2000-09-18 16:07:07 +00:00
|
|
|
FuDraw::Activate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuConstruct::Deactivate()
|
|
|
|
{
|
|
|
|
FuDraw::Deactivate();
|
2016-08-19 14:31:46 +02:00
|
|
|
mpView->SetEditMode(SdrViewEditMode::Edit);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-03-12 20:27:21 +01:00
|
|
|
/**
|
|
|
|
* set style sheet for the object to be created
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj)
|
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bUseFillStyle, bUseNoFillStyle;
|
|
|
|
bUseFillStyle = bUseNoFillStyle = false;
|
2004-10-12 12:10:28 +00:00
|
|
|
|
2010-11-30 16:49:41 +01:00
|
|
|
switch( nSlotId )
|
|
|
|
{
|
|
|
|
case SID_DRAW_RECT:
|
|
|
|
case SID_DRAW_RECT_ROUND:
|
|
|
|
case SID_DRAW_SQUARE:
|
|
|
|
case SID_DRAW_SQUARE_ROUND:
|
|
|
|
case SID_DRAW_ELLIPSE:
|
|
|
|
case SID_DRAW_PIE:
|
|
|
|
case SID_DRAW_ELLIPSECUT:
|
|
|
|
case SID_DRAW_CIRCLE:
|
|
|
|
case SID_DRAW_CIRCLEPIE:
|
|
|
|
case SID_DRAW_CIRCLECUT:
|
|
|
|
case SID_DRAW_POLYGON:
|
|
|
|
case SID_DRAW_XPOLYGON:
|
|
|
|
case SID_DRAW_FREELINE:
|
|
|
|
case SID_DRAW_BEZIER_FILL:
|
2004-10-12 12:10:28 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bUseFillStyle = true;
|
2010-11-30 16:49:41 +01:00
|
|
|
break;
|
2004-10-12 12:10:28 +00:00
|
|
|
}
|
2010-11-30 16:49:41 +01:00
|
|
|
case SID_DRAW_RECT_NOFILL:
|
|
|
|
case SID_DRAW_RECT_ROUND_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE_NOFILL:
|
|
|
|
case SID_DRAW_SQUARE_ROUND_NOFILL:
|
|
|
|
case SID_DRAW_ELLIPSE_NOFILL:
|
|
|
|
case SID_DRAW_PIE_NOFILL:
|
|
|
|
case SID_DRAW_ELLIPSECUT_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLEPIE_NOFILL:
|
|
|
|
case SID_DRAW_CIRCLECUT_NOFILL:
|
|
|
|
case SID_DRAW_POLYGON_NOFILL:
|
|
|
|
case SID_DRAW_XPOLYGON_NOFILL:
|
|
|
|
case SID_DRAW_FREELINE_NOFILL:
|
|
|
|
case SID_DRAW_LINE:
|
|
|
|
case SID_DRAW_XLINE:
|
|
|
|
case SID_CONNECTOR_ARROW_START:
|
|
|
|
case SID_CONNECTOR_ARROW_END:
|
|
|
|
case SID_CONNECTOR_ARROWS:
|
|
|
|
case SID_CONNECTOR_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_CIRCLES:
|
|
|
|
case SID_CONNECTOR_LINE:
|
|
|
|
case SID_CONNECTOR_LINE_ARROW_START:
|
|
|
|
case SID_CONNECTOR_LINE_ARROW_END:
|
|
|
|
case SID_CONNECTOR_LINE_ARROWS:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_LINE_CIRCLES:
|
|
|
|
case SID_CONNECTOR_CURVE:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROW_START:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROW_END:
|
|
|
|
case SID_CONNECTOR_CURVE_ARROWS:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_CURVE_CIRCLES:
|
|
|
|
case SID_CONNECTOR_LINES:
|
|
|
|
case SID_CONNECTOR_LINES_ARROW_START:
|
|
|
|
case SID_CONNECTOR_LINES_ARROW_END:
|
|
|
|
case SID_CONNECTOR_LINES_ARROWS:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLE_START:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLE_END:
|
|
|
|
case SID_CONNECTOR_LINES_CIRCLES:
|
|
|
|
case SID_DRAW_BEZIER_NOFILL:
|
|
|
|
case SID_LINE_ARROW_END:
|
2004-10-12 12:10:28 +00:00
|
|
|
{
|
2014-04-24 10:52:02 +02:00
|
|
|
bUseNoFillStyle = true;
|
2010-11-30 16:49:41 +01:00
|
|
|
break;
|
|
|
|
}
|
2004-10-12 12:10:28 +00:00
|
|
|
}
|
|
|
|
SetStyleSheet( rAttr, pObj, bUseFillStyle, bUseNoFillStyle );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-10-12 12:10:28 +00:00
|
|
|
void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj,
|
2014-04-24 10:52:02 +02:00
|
|
|
const bool bForceFillStyle, const bool bForceNoFillStyle )
|
2004-10-12 12:10:28 +00:00
|
|
|
{
|
2014-10-29 11:04:25 +02:00
|
|
|
SdPage* pPage = static_cast<SdPage*>(mpView->GetSdrPageView()->GetPage());
|
2016-10-11 13:01:32 +02:00
|
|
|
if ( pPage->IsMasterPage() && pPage->GetPageKind() == PageKind::Standard &&
|
2016-10-11 12:21:55 +02:00
|
|
|
mpDoc->GetDocumentType() == DocumentType::Impress )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-10-12 12:10:28 +00:00
|
|
|
/**********************************************
|
|
|
|
* Objects was created on the slide master page
|
|
|
|
***********************************************/
|
2013-08-24 22:22:45 +04:00
|
|
|
OUString aName( pPage->GetLayoutName() );
|
|
|
|
sal_Int32 n = aName.indexOf(SD_LT_SEPARATOR) + strlen(SD_LT_SEPARATOR);
|
2020-11-06 20:01:50 +02:00
|
|
|
aName = OUString::Concat(aName.subView(0, n)) + STR_LAYOUT_BACKGROUNDOBJECTS;
|
SOSAW080: Added first bunch of basic changes to helpers
SOSAW080: Make SdrModel& prerequisite to SdrObjects
Added need for SdrModel& in constructors of SdrModel,
SdrPage, SdrView and SdrObjList. Builds, not finished.
SOSAW080: removed and replaced old SdrModel
Removed and replaced GetModel()/SetModel() in all using
classes (SdrObject, SdrPage, SdrView), added accessors
to new referenced SdrModel, adapted all accessing places.
Refactored/Extended ::Clone and ::operator== for these
classes to allow cloning objects to a target SdrModel.
Adapted places where this is done AFAP. Added quite some
comments (tagged with 'TTTT') where possible further work
is needed. Builds completely, thus checking in. This does
not mean that this change is done yet.
SOSAW080: Adapted SdrPage/SdrModel relationship
Also needed to work on copy-construction of SdrPage and hierarchy,
quite some stuff removed, no copy-constructor anymore, no
MigrateItemPool stuff. Builds well, test stuck, will need
some cleanup/finetunung
SOSAW080: Smaller corrections/includes adapted
SOSAW080: Smaller corrections/includes adapted
SOSAW080: Debugging/Stabilizing/MakeUnitTestWork
SOSAW080: Stabilized for UnitTests, cleanups
SOSAW080: Adapted GetObjGraphic to just take a const SdrObject&
SOSAW080: Removed ChangeModel from classes
Classes SvxTextEditSource and SvxDrawPage (including
TextEditSource stuff) do not need change of SdrModel
anymore.
SOSAW080: Adapted some comments to make more readable
SOSAW080: Corrected constructor
SOSAW080: getSdrModelFromUnoModel added override marks
SOSAW080: Added missing includes
SOSAW080: Corrected SdrPage constructor
SOSAW080: Corrected some SdrObject::Clone scenarios
Especially when cloning to another SdrModel and taking
the sdr::properties into account.
SOSAW080: Added include for Mac-Build
SOSAW080: Added Scale to DefaultProperties
If a SdrModel change happens in DefaultProperties copy
constructor (used from Clone()), potentially a Scale
for the SfxItems has to be done.
SOSAW080: Added missing include for MacBuild
SOSAW080: Corrected CppunitTest_sc_anchor_test
An adaption of a SdrPathObj instantiation was missing,
added that. Seems as if that test is no tpart of the
usual 'make' scenario, but used/executed in gerrit builds
SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
SOSAW080: Free SdrObjects when SdrModel goes down
In an UNO API test problem is that SvxShapes reference
SdrShapes, but these are not added to a SdrPage and not
'owned' by the SvxShape. Thus these do not get deleted
at all (same in master, memory leak). I extended
SvxShape::Notify the case for ModelCleared to also
Free the SdrObject when not owner and it's not added to
a SdrPage (in that case it gets deleted with deleting
the SdrModel)
SOSAW080: Solve UNO API calls that move SvxShapes to other Model
Due to UNO API tests I got a call to insert an xShape to a
xDrawPage which was constructed in another Model, this has now to
be done by Cloning the SdrObject to the new SdrModel, getting
rid of the old one and getting all the UNO implementation
stuff right (referemces SdrObject <-> xShape).
1cb7d573d323e98a89761fe662c10c4a654fdec0
24617494a0ef79f6e33dfcb02782a833a81c6434
763f39094b6a48b529a6952d01468f8776c97679
242b9e228a9a042c3a5bdd38b1ea6600144276d5
242b9e228a9a042c3a5bdd38b1ea6600144276d5
33a6f3f306b70c223171aef796dd5ee041ad14df
6878b33f8b05738a44c0910e40a60a0f0d1d58ed
0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2
8c4626274a5cc531dad27f27c0c45d4c528fb2fb
446685a49a6d67aedd01cfbbd5e87b07f97a4d7b
c1b5ed3c99bc7219a0061e4ece24ea42afd2889a
22de9a1c8af7c25be5c108671ddc548ba323ed47
4caf6b6fbbe6e8130741d793dffb560fd01d4ed5
488b9601735ec1822433f82f633990063951fe08
c366d60299f239e3df856ddffedb19e743e4be0c
c5137ba8c597c7b5f90318df50e87b93a39a28dc
f9e646242cf89f6fde1315046952252a2c429779
f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410
1694b54903df784385abaa8452e1201e12344238
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
7b5c241faec7488924e5935ae8b19f785846b5e4
bf097ee7467895823fbd158a2a9543da3b5a5078
Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c
Reviewed-on: https://gerrit.libreoffice.org/52526
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-03-01 15:54:32 +01:00
|
|
|
SfxStyleSheet* pSheet(
|
|
|
|
static_cast< SfxStyleSheet* >(
|
|
|
|
pPage->getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SfxStyleFamily::Page)));
|
2013-03-11 22:51:42 +01:00
|
|
|
DBG_ASSERT(pSheet, "StyleSheet missing");
|
2000-09-18 16:07:07 +00:00
|
|
|
if (pSheet)
|
|
|
|
{
|
2004-10-12 12:10:28 +00:00
|
|
|
// applying style sheet for background objects
|
2014-01-28 20:00:21 +01:00
|
|
|
pObj->SetStyleSheet(pSheet, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxItemSet& rSet = pSheet->GetItemSet();
|
2017-11-16 16:16:22 +02:00
|
|
|
const XFillStyleItem& rFillStyle = rSet.Get(XATTR_FILLSTYLE);
|
2004-10-12 12:10:28 +00:00
|
|
|
if ( bForceFillStyle )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-07-18 18:07:36 +02:00
|
|
|
if (rFillStyle.GetValue() == drawing::FillStyle_NONE)
|
|
|
|
rAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2004-10-12 12:10:28 +00:00
|
|
|
else if ( bForceNoFillStyle )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-07-18 18:07:36 +02:00
|
|
|
if (rFillStyle.GetValue() != drawing::FillStyle_NONE)
|
|
|
|
rAttr.Put(XFillStyleItem(drawing::FillStyle_NONE));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-12 12:10:28 +00:00
|
|
|
/***********************************
|
|
|
|
* object was created on normal page
|
|
|
|
************************************/
|
|
|
|
if ( bForceNoFillStyle )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2017-05-18 21:14:00 +01:00
|
|
|
OUString aName(SdResId(STR_POOLSHEET_OBJWITHOUTFILL));
|
SOSAW080: Added first bunch of basic changes to helpers
SOSAW080: Make SdrModel& prerequisite to SdrObjects
Added need for SdrModel& in constructors of SdrModel,
SdrPage, SdrView and SdrObjList. Builds, not finished.
SOSAW080: removed and replaced old SdrModel
Removed and replaced GetModel()/SetModel() in all using
classes (SdrObject, SdrPage, SdrView), added accessors
to new referenced SdrModel, adapted all accessing places.
Refactored/Extended ::Clone and ::operator== for these
classes to allow cloning objects to a target SdrModel.
Adapted places where this is done AFAP. Added quite some
comments (tagged with 'TTTT') where possible further work
is needed. Builds completely, thus checking in. This does
not mean that this change is done yet.
SOSAW080: Adapted SdrPage/SdrModel relationship
Also needed to work on copy-construction of SdrPage and hierarchy,
quite some stuff removed, no copy-constructor anymore, no
MigrateItemPool stuff. Builds well, test stuck, will need
some cleanup/finetunung
SOSAW080: Smaller corrections/includes adapted
SOSAW080: Smaller corrections/includes adapted
SOSAW080: Debugging/Stabilizing/MakeUnitTestWork
SOSAW080: Stabilized for UnitTests, cleanups
SOSAW080: Adapted GetObjGraphic to just take a const SdrObject&
SOSAW080: Removed ChangeModel from classes
Classes SvxTextEditSource and SvxDrawPage (including
TextEditSource stuff) do not need change of SdrModel
anymore.
SOSAW080: Adapted some comments to make more readable
SOSAW080: Corrected constructor
SOSAW080: getSdrModelFromUnoModel added override marks
SOSAW080: Added missing includes
SOSAW080: Corrected SdrPage constructor
SOSAW080: Corrected some SdrObject::Clone scenarios
Especially when cloning to another SdrModel and taking
the sdr::properties into account.
SOSAW080: Added include for Mac-Build
SOSAW080: Added Scale to DefaultProperties
If a SdrModel change happens in DefaultProperties copy
constructor (used from Clone()), potentially a Scale
for the SfxItems has to be done.
SOSAW080: Added missing include for MacBuild
SOSAW080: Corrected CppunitTest_sc_anchor_test
An adaption of a SdrPathObj instantiation was missing,
added that. Seems as if that test is no tpart of the
usual 'make' scenario, but used/executed in gerrit builds
SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
SOSAW080: Free SdrObjects when SdrModel goes down
In an UNO API test problem is that SvxShapes reference
SdrShapes, but these are not added to a SdrPage and not
'owned' by the SvxShape. Thus these do not get deleted
at all (same in master, memory leak). I extended
SvxShape::Notify the case for ModelCleared to also
Free the SdrObject when not owner and it's not added to
a SdrPage (in that case it gets deleted with deleting
the SdrModel)
SOSAW080: Solve UNO API calls that move SvxShapes to other Model
Due to UNO API tests I got a call to insert an xShape to a
xDrawPage which was constructed in another Model, this has now to
be done by Cloning the SdrObject to the new SdrModel, getting
rid of the old one and getting all the UNO implementation
stuff right (referemces SdrObject <-> xShape).
1cb7d573d323e98a89761fe662c10c4a654fdec0
24617494a0ef79f6e33dfcb02782a833a81c6434
763f39094b6a48b529a6952d01468f8776c97679
242b9e228a9a042c3a5bdd38b1ea6600144276d5
242b9e228a9a042c3a5bdd38b1ea6600144276d5
33a6f3f306b70c223171aef796dd5ee041ad14df
6878b33f8b05738a44c0910e40a60a0f0d1d58ed
0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2
8c4626274a5cc531dad27f27c0c45d4c528fb2fb
446685a49a6d67aedd01cfbbd5e87b07f97a4d7b
c1b5ed3c99bc7219a0061e4ece24ea42afd2889a
22de9a1c8af7c25be5c108671ddc548ba323ed47
4caf6b6fbbe6e8130741d793dffb560fd01d4ed5
488b9601735ec1822433f82f633990063951fe08
c366d60299f239e3df856ddffedb19e743e4be0c
c5137ba8c597c7b5f90318df50e87b93a39a28dc
f9e646242cf89f6fde1315046952252a2c429779
f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410
1694b54903df784385abaa8452e1201e12344238
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
7b5c241faec7488924e5935ae8b19f785846b5e4
bf097ee7467895823fbd158a2a9543da3b5a5078
Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c
Reviewed-on: https://gerrit.libreoffice.org/52526
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-03-01 15:54:32 +01:00
|
|
|
SfxStyleSheet* pSheet(
|
|
|
|
static_cast< SfxStyleSheet* >(
|
|
|
|
pPage->getSdrModelFromSdrPage().GetStyleSheetPool()->Find(aName, SfxStyleFamily::Para)));
|
2013-03-11 22:51:42 +01:00
|
|
|
DBG_ASSERT(pSheet, "Stylesheet missing");
|
2000-09-18 16:07:07 +00:00
|
|
|
if (pSheet)
|
|
|
|
{
|
2014-01-28 20:00:21 +01:00
|
|
|
pObj->SetStyleSheet(pSheet, false);
|
2018-10-26 12:06:27 +02:00
|
|
|
SfxItemSet aAttr(mpView->GetDefaultAttr());
|
2000-09-18 16:07:07 +00:00
|
|
|
aAttr.Put(pSheet->GetItemSet().Get(XATTR_FILLSTYLE));
|
2003-11-24 16:12:23 +00:00
|
|
|
pObj->SetMergedItemSet(aAttr);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-10-26 12:06:27 +02:00
|
|
|
SfxItemSet aAttr(mpView->GetDefaultAttr());
|
2014-07-18 18:07:36 +02:00
|
|
|
rAttr.Put(XFillStyleItem(drawing::FillStyle_NONE));
|
2003-11-24 16:12:23 +00:00
|
|
|
pObj->SetMergedItemSet(aAttr);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-20 09:59:25 +00:00
|
|
|
} // end of namespace sd
|
2010-10-12 15:51:52 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|