2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 14:21:42 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 12:51:55 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-01-20 04:05:47 -06:00
|
|
|
#include "fumeasur.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2004-01-20 04:05:47 -06:00
|
|
|
#include "View.hxx"
|
|
|
|
#include "ViewShell.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "drawdoc.hxx"
|
2006-12-12 10:19:46 -06:00
|
|
|
#include <svx/svxdlg.hxx>
|
|
|
|
#include <svx/dialogs.hrc>
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-01-20 04:05:47 -06:00
|
|
|
namespace sd {
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
TYPEINIT1( FuMeasureDlg, FuPoor );
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Konstruktor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 04:05:47 -06:00
|
|
|
FuMeasureDlg::FuMeasureDlg (
|
|
|
|
ViewShell* pViewSh,
|
|
|
|
::sd::Window* pWin,
|
|
|
|
::sd::View* pView,
|
|
|
|
SdDrawDocument* pDoc,
|
|
|
|
SfxRequest& rReq)
|
|
|
|
: FuPoor(pViewSh, pWin, pView, pDoc, rReq)
|
2005-12-14 10:00:19 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
FunctionReference FuMeasureDlg::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
|
|
|
|
{
|
|
|
|
FunctionReference xFunc( new FuMeasureDlg( pViewSh, pWin, pView, pDoc, rReq ) );
|
|
|
|
xFunc->DoExecute(rReq);
|
|
|
|
return xFunc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FuMeasureDlg::DoExecute( SfxRequest& rReq )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 10:19:46 -06:00
|
|
|
SfxItemSet aNewAttr( mpDoc->GetPool() );
|
|
|
|
mpView->GetAttributes( aNewAttr );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if( !pArgs )
|
|
|
|
{
|
2004-02-04 03:09:53 -06:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
2009-05-06 05:59:57 -05:00
|
|
|
::std::auto_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( NULL, aNewAttr, mpView, RID_SVXPAGE_MEASURE) : 0 );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2006-12-12 10:19:46 -06:00
|
|
|
if( pDlg.get() && (pDlg->Execute() == RET_OK) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2006-12-12 10:19:46 -06:00
|
|
|
rReq.Done( *pDlg->GetOutputItemSet() );
|
|
|
|
pArgs = rReq.GetArgs();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
}
|
2006-12-12 10:19:46 -06:00
|
|
|
|
|
|
|
if( pArgs )
|
|
|
|
mpView->SetAttributes( *pArgs );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-20 04:05:47 -06:00
|
|
|
} // end of namespace sd
|