2007-07-09 10:56:41 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 18:13:30 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00:00
|
|
|
* $RCSfile: DesignView.cxx,v $
|
2008-08-19 09:16:24 +00:00
|
|
|
* $Revision: 1.8 $
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00: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.
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00: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).
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
2008-04-10 18:13:30 +00: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.
|
2007-07-09 10:56:41 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#include "precompiled_reportdesign.hxx"
|
|
|
|
|
|
|
|
#include "DesignView.hxx"
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#include "ReportController.hxx"
|
|
|
|
#include <comphelper/types.hxx>
|
|
|
|
#include <svtools/syslocale.hxx>
|
2008-12-09 07:25:38 +00:00
|
|
|
#include <svtools/viewoptions.hxx>
|
2007-07-09 10:56:41 +00:00
|
|
|
#include "RptDef.hxx"
|
|
|
|
#include "UITools.hxx"
|
|
|
|
#include "RptObject.hxx"
|
|
|
|
#include "propbrw.hxx"
|
|
|
|
#include <toolkit/helper/convert.hxx>
|
|
|
|
#include "helpids.hrc"
|
|
|
|
#include "SectionView.hxx"
|
|
|
|
#include "ReportSection.hxx"
|
|
|
|
#include "rptui_slotid.hrc"
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include "AddField.hxx"
|
|
|
|
#include "ScrollHelper.hxx"
|
|
|
|
#include "Navigator.hxx"
|
2008-08-19 09:16:24 +00:00
|
|
|
#include "SectionWindow.hxx"
|
2008-12-09 07:25:38 +00:00
|
|
|
#include "RptResId.hrc"
|
2007-07-09 10:56:41 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
|
|
|
namespace rptui
|
|
|
|
{
|
|
|
|
using namespace ::dbaui;
|
|
|
|
using namespace ::utl;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace uno;
|
|
|
|
using namespace lang;
|
|
|
|
using namespace beans;
|
|
|
|
using namespace container;
|
|
|
|
|
|
|
|
#define LINE_SIZE 50
|
2008-01-29 12:50:32 +00:00
|
|
|
#define START_SIZE_TASKPANE 30
|
|
|
|
#define COLSET_ID 1
|
|
|
|
#define REPORT_ID 2
|
|
|
|
#define TASKPANE_ID 3
|
|
|
|
|
|
|
|
class OTaskWindow : public Window
|
|
|
|
{
|
|
|
|
PropBrw* m_pPropWin;
|
|
|
|
public:
|
|
|
|
OTaskWindow(Window* _pParent) : Window(_pParent),m_pPropWin(NULL){}
|
|
|
|
|
|
|
|
inline void setPropertyBrowser(PropBrw* _pPropWin)
|
|
|
|
{
|
|
|
|
m_pPropWin = _pPropWin;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Resize()
|
|
|
|
{
|
|
|
|
const Size aSize = GetOutputSizePixel();
|
|
|
|
if ( m_pPropWin && aSize.Height() && aSize.Width() )
|
|
|
|
m_pPropWin->SetSizePixel(aSize);
|
|
|
|
}
|
|
|
|
long getMinimumWidth() const
|
|
|
|
{
|
|
|
|
long nRet = 0;
|
|
|
|
if ( m_pPropWin )
|
|
|
|
nRet = m_pPropWin->getMinimumSize().Width();
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
class OwnSplitWindow : public SplitWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OwnSplitWindow(Window* pParent) : SplitWindow(pParent,WB_DIALOGCONTROL){SetBackground( );}
|
|
|
|
|
|
|
|
virtual void Split()
|
|
|
|
{
|
|
|
|
SplitWindow::Split();
|
|
|
|
setItemSizes();
|
|
|
|
}
|
|
|
|
void setItemSizes()
|
|
|
|
{
|
|
|
|
const long nOutWidth = GetOutputSizePixel().Width();
|
|
|
|
long nTaskPaneMinSplitSize = static_cast<OTaskWindow*>(GetItemWindow(TASKPANE_ID))->getMinimumWidth();
|
|
|
|
nTaskPaneMinSplitSize = static_cast<long>(nTaskPaneMinSplitSize*100/nOutWidth);
|
|
|
|
if ( !nTaskPaneMinSplitSize )
|
|
|
|
nTaskPaneMinSplitSize = START_SIZE_TASKPANE;
|
|
|
|
|
|
|
|
const long nReportMinSplitSize = static_cast<long>(12000/nOutWidth);
|
|
|
|
|
|
|
|
long nReportSize = GetItemSize( REPORT_ID );
|
|
|
|
long nTaskPaneSize = GetItemSize( TASKPANE_ID );
|
|
|
|
|
|
|
|
BOOL bMod = FALSE;
|
|
|
|
if( nReportSize < nReportMinSplitSize )
|
|
|
|
{
|
|
|
|
nReportSize = nReportMinSplitSize;
|
|
|
|
nTaskPaneSize = 99 - nReportMinSplitSize;
|
|
|
|
|
|
|
|
bMod = TRUE;
|
|
|
|
}
|
|
|
|
else if( nTaskPaneSize < nTaskPaneMinSplitSize )
|
|
|
|
{
|
|
|
|
nTaskPaneSize = nTaskPaneMinSplitSize;
|
|
|
|
nReportSize = 99 - nTaskPaneMinSplitSize;
|
|
|
|
|
|
|
|
bMod = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bMod )
|
|
|
|
{
|
|
|
|
SetItemSize( REPORT_ID, nReportSize );
|
|
|
|
SetItemSize( TASKPANE_ID, nTaskPaneSize );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2007-07-09 10:56:41 +00:00
|
|
|
//==================================================================
|
|
|
|
// class ODesignView
|
|
|
|
//==================================================================
|
|
|
|
DBG_NAME( rpt_ODesignView )
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
ODesignView::ODesignView( Window* pParent,
|
|
|
|
const Reference< XMultiServiceFactory >& _rxOrb,
|
2008-06-25 10:36:51 +00:00
|
|
|
OReportController& _rController) :
|
|
|
|
ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL )
|
2008-08-19 09:16:24 +00:00
|
|
|
,m_aSplitWin(this)
|
2008-06-25 10:36:51 +00:00
|
|
|
,m_rReportController( _rController )
|
2008-08-19 09:16:24 +00:00
|
|
|
,m_aScrollWindow(this)
|
2007-07-09 10:56:41 +00:00
|
|
|
,m_pPropWin(NULL)
|
|
|
|
,m_pAddField(NULL)
|
|
|
|
,m_pCurrentView(NULL)
|
|
|
|
,m_pReportExplorer(NULL)
|
|
|
|
,m_eMode( RPTUI_SELECT )
|
|
|
|
,m_nCurrentPosition(USHRT_MAX)
|
|
|
|
,m_eActObj( OBJ_NONE )
|
|
|
|
,m_bFirstDraw(FALSE)
|
2009-01-09 12:44:15 +00:00
|
|
|
,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid
|
|
|
|
,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation
|
2007-07-09 10:56:41 +00:00
|
|
|
,m_bGridVisible(TRUE)
|
|
|
|
,m_bGridSnap(TRUE)
|
2008-08-19 09:16:24 +00:00
|
|
|
,m_bDeleted( FALSE )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
|
|
|
DBG_CTOR( rpt_ODesignView,NULL);
|
2008-01-29 12:50:32 +00:00
|
|
|
SetHelpId(UID_RPT_RPT_APP_VIEW);
|
2007-07-09 10:56:41 +00:00
|
|
|
ImplInitSettings();
|
|
|
|
|
|
|
|
SetMapMode( MapMode( MAP_100TH_MM ) );
|
|
|
|
|
|
|
|
// now create the task pane on the right side :-)
|
2008-01-29 12:50:32 +00:00
|
|
|
m_pTaskPane = new OTaskWindow(this);
|
|
|
|
//m_pTaskPane->Show();
|
|
|
|
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET );
|
|
|
|
m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100/*m_aScrollWindow.getMaxMarkerWidth(sal_False)*/, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE /*SWIB_COLSET*/);
|
|
|
|
//m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane, 50, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE );
|
2007-07-09 10:56:41 +00:00
|
|
|
|
|
|
|
// Splitter einrichten
|
2008-01-29 12:50:32 +00:00
|
|
|
//m_aSplitter.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
|
|
|
|
m_aSplitWin.ShowAutoHideButton();
|
|
|
|
m_aSplitWin.SetAlign(WINDOWALIGN_LEFT);
|
|
|
|
m_aSplitWin.Show();
|
2007-07-09 10:56:41 +00:00
|
|
|
|
|
|
|
m_aMarkTimer.SetTimeout( 100 );
|
|
|
|
m_aMarkTimer.SetTimeoutHdl( LINK( this, ODesignView, MarkTimeout ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
ODesignView::~ODesignView()
|
|
|
|
{
|
|
|
|
DBG_DTOR( rpt_ODesignView,NULL);
|
2008-08-19 09:16:24 +00:00
|
|
|
m_bDeleted = TRUE;
|
|
|
|
Hide();
|
|
|
|
m_aScrollWindow.Hide();
|
2007-07-09 10:56:41 +00:00
|
|
|
m_aMarkTimer.Stop();
|
|
|
|
if ( m_pPropWin )
|
|
|
|
{
|
|
|
|
notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
|
|
|
|
::std::auto_ptr<Window> aTemp2(m_pPropWin);
|
|
|
|
m_pPropWin = NULL;
|
|
|
|
}
|
|
|
|
if ( m_pAddField )
|
|
|
|
{
|
2008-12-09 07:25:38 +00:00
|
|
|
SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) );
|
|
|
|
aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pAddField->GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)).GetBuffer() ) );
|
2007-07-09 10:56:41 +00:00
|
|
|
notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
|
|
|
|
::std::auto_ptr<Window> aTemp2(m_pAddField);
|
|
|
|
m_pAddField = NULL;
|
|
|
|
}
|
|
|
|
if ( m_pReportExplorer )
|
|
|
|
{
|
2008-12-09 07:25:38 +00:00
|
|
|
SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) );
|
|
|
|
aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pReportExplorer->GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)).GetBuffer() ) );
|
2007-07-09 10:56:41 +00:00
|
|
|
notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
|
|
|
|
::std::auto_ptr<Window> aTemp2(m_pReportExplorer);
|
|
|
|
m_pReportExplorer = NULL;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
::std::auto_ptr<Window> aTemp2(m_pTaskPane);
|
|
|
|
m_pTaskPane = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::initialize()
|
|
|
|
{
|
|
|
|
SetMapMode( MapMode( MAP_100TH_MM ) );
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.initialize();
|
|
|
|
m_aScrollWindow.Show();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::DataChanged( const DataChangedEvent& rDCEvt )
|
|
|
|
{
|
|
|
|
ODataView::DataChanged( rDCEvt );
|
|
|
|
|
|
|
|
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
|
|
|
|
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
|
|
|
|
{
|
|
|
|
ImplInitSettings();
|
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
long ODesignView::PreNotify( NotifyEvent& rNEvt )
|
|
|
|
{
|
|
|
|
long nRet = ODataView::PreNotify(rNEvt); // 1 := has to be handled here
|
|
|
|
switch(rNEvt.GetType())
|
|
|
|
{
|
|
|
|
case EVENT_KEYINPUT:
|
|
|
|
//if ( nRet != 1L )
|
|
|
|
{
|
|
|
|
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
|
|
|
|
if ( handleKeyEvent(*pKeyEvent) )
|
|
|
|
nRet = 1L;
|
2008-06-25 10:36:51 +00:00
|
|
|
else if ( nRet == 1L && m_pAccel.get() )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
|
|
|
const KeyCode& rCode = pKeyEvent->GetKeyCode();
|
|
|
|
util::URL aUrl;
|
|
|
|
aUrl.Complete = m_pAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rCode));
|
2008-06-25 10:36:51 +00:00
|
|
|
if ( !aUrl.Complete.getLength() || !m_rController.isCommandEnabled( aUrl.Complete ) )
|
2007-07-09 10:56:41 +00:00
|
|
|
nRet = 0L;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODesignView::resizeDocumentView(Rectangle& _rPlayground)
|
|
|
|
{
|
|
|
|
if ( !_rPlayground.IsEmpty() )
|
|
|
|
{
|
|
|
|
const Size aPlaygroundSize( _rPlayground.GetSize() );
|
|
|
|
|
|
|
|
// calc the split pos, and forward it to the controller
|
2008-06-25 10:36:51 +00:00
|
|
|
sal_Int32 nSplitPos = getController().getSplitPos();
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( 0 != aPlaygroundSize.Width() )
|
|
|
|
{
|
|
|
|
if ( ( -1 == nSplitPos )
|
|
|
|
|| ( nSplitPos >= aPlaygroundSize.Width() )
|
|
|
|
)
|
|
|
|
{
|
|
|
|
long nMinWidth = static_cast<long>(0.1*aPlaygroundSize.Width());
|
|
|
|
if ( m_pPropWin && m_pPropWin->IsVisible() )
|
|
|
|
nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
|
|
|
|
nSplitPos = static_cast<sal_Int32>(_rPlayground.Right() - nMinWidth);
|
2008-06-25 10:36:51 +00:00
|
|
|
getController().setSplitPos(nSplitPos);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
} // if ( 0 != _rPlaygroundSize.Width() )
|
|
|
|
|
|
|
|
Size aReportWindowSize(aPlaygroundSize);
|
2008-08-19 09:16:24 +00:00
|
|
|
if ( m_aSplitWin.IsItemValid(TASKPANE_ID) )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
|
|
|
// normalize the split pos
|
2008-01-29 12:50:32 +00:00
|
|
|
const long nSplitterWidth = GetSettings().GetStyleSettings().GetSplitSize();
|
|
|
|
Point aTaskPanePos(nSplitPos + nSplitterWidth, _rPlayground.Top());
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( m_pTaskPane && m_pTaskPane->IsVisible() )
|
|
|
|
{
|
|
|
|
aTaskPanePos.X() = aPlaygroundSize.Width() - m_pTaskPane->GetSizePixel().Width();
|
2008-01-29 12:50:32 +00:00
|
|
|
sal_Int32 nMinWidth = m_pPropWin->getMinimumSize().Width();
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( nMinWidth > (aPlaygroundSize.Width() - aTaskPanePos.X()) )
|
|
|
|
{
|
|
|
|
aTaskPanePos.X() = aPlaygroundSize.Width() - nMinWidth;
|
|
|
|
}
|
2008-01-29 12:50:32 +00:00
|
|
|
nSplitPos = aTaskPanePos.X() - nSplitterWidth;
|
2008-06-25 10:36:51 +00:00
|
|
|
getController().setSplitPos(nSplitPos);
|
2007-07-09 10:56:41 +00:00
|
|
|
|
2008-01-29 12:50:32 +00:00
|
|
|
const long nTaskPaneSize = static_cast<long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
|
2008-08-19 09:16:24 +00:00
|
|
|
if ( m_aSplitWin.GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
|
2008-01-29 12:50:32 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
|
|
|
|
m_aSplitWin.SetItemSize( TASKPANE_ID, nTaskPaneSize );
|
2008-01-29 12:50:32 +00:00
|
|
|
}
|
|
|
|
}
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// set the size of the report window
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize );
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// just for completeness: there is no space left, we occupied it all ...
|
|
|
|
_rPlayground.SetPos( _rPlayground.BottomRight() );
|
|
|
|
_rPlayground.SetSize( Size( 0, 0 ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// set the view readonly or not
|
|
|
|
void ODesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
IMPL_LINK( ODesignView, MarkTimeout, Timer *, EMPTYARG )
|
|
|
|
{
|
|
|
|
if ( m_pPropWin && m_pPropWin->IsVisible() )
|
|
|
|
{
|
|
|
|
m_pPropWin->Update(m_pCurrentView);
|
|
|
|
uno::Reference<beans::XPropertySet> xProp(m_xReportComponent,uno::UNO_QUERY);
|
|
|
|
if ( xProp.is() )
|
2008-01-29 12:50:32 +00:00
|
|
|
{
|
2007-07-09 10:56:41 +00:00
|
|
|
m_pPropWin->Update(xProp);
|
2008-01-29 12:50:32 +00:00
|
|
|
static_cast<OTaskWindow*>(m_pTaskPane)->Resize();
|
|
|
|
}
|
2007-07-09 10:56:41 +00:00
|
|
|
Resize();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::SetMode( DlgEdMode _eNewMode )
|
|
|
|
{
|
|
|
|
m_eMode = _eNewMode;
|
|
|
|
if ( m_eMode == RPTUI_SELECT )
|
|
|
|
m_eActObj = OBJ_NONE;
|
2008-08-19 09:16:24 +00:00
|
|
|
|
|
|
|
m_aScrollWindow.SetMode(_eNewMode);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
|
|
|
|
{
|
|
|
|
m_eActObj = eObj;
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.SetInsertObj( eObj,_sShapeType );
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
2007-08-02 13:40:37 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
rtl::OUString ODesignView::GetInsertObjString() const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.GetInsertObjString();
|
2007-08-02 13:40:37 +00:00
|
|
|
}
|
2007-07-09 10:56:41 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
USHORT ODesignView::GetInsertObj() const
|
|
|
|
{
|
|
|
|
return m_eActObj;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::Cut()
|
|
|
|
{
|
|
|
|
Copy();
|
|
|
|
Delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void ODesignView::Copy()
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.Copy();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void ODesignView::Paste()
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.Paste();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::Delete()
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.Delete();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
BOOL ODesignView::HasSelection()
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.HasSelection();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
BOOL ODesignView::IsPasteAllowed()
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.IsPasteAllowed();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
2008-08-19 09:16:24 +00:00
|
|
|
void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView)
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
if ( m_pCurrentView != &_rView )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
if ( m_pCurrentView )
|
|
|
|
m_aScrollWindow.setMarked(m_pCurrentView,sal_False);
|
|
|
|
m_pCurrentView = &_rView;
|
|
|
|
if ( m_pCurrentView )
|
|
|
|
m_aScrollWindow.setMarked(m_pCurrentView,sal_True);
|
2007-07-09 10:56:41 +00:00
|
|
|
m_xReportComponent.clear();
|
|
|
|
DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED );
|
|
|
|
Broadcast( aHint );
|
|
|
|
}
|
|
|
|
m_aMarkTimer.Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::toggleGrid(sal_Bool _bGridVisible)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.toggleGrid(_bGridVisible);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
USHORT ODesignView::getSectionCount() const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.getSectionCount();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::showRuler(sal_Bool _bShow)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.showRuler(_bShow);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::removeSection(USHORT _nPosition)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.removeSection(_nPosition);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::GetFocus()
|
|
|
|
{
|
|
|
|
Window::GetFocus();
|
2008-08-19 09:16:24 +00:00
|
|
|
|
|
|
|
if ( !m_bDeleted )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aScrollWindow.getMarkedSection();
|
|
|
|
if ( pSectionWindow )
|
|
|
|
pSectionWindow->GrabFocus();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::ImplInitSettings()
|
|
|
|
{
|
2008-01-29 12:50:32 +00:00
|
|
|
//#if OSL_DEBUG_LEVEL > 0
|
|
|
|
// SetBackground( Wallpaper( COL_RED ));
|
|
|
|
//#else
|
2007-07-09 10:56:41 +00:00
|
|
|
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
|
2008-01-29 12:50:32 +00:00
|
|
|
//#endif
|
2007-07-09 10:56:41 +00:00
|
|
|
SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
|
|
|
|
SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
IMPL_LINK( ODesignView, SplitHdl, void*, )
|
|
|
|
{
|
|
|
|
const Size aOutputSize = GetOutputSizePixel();
|
2008-08-19 09:16:24 +00:00
|
|
|
const long nTest = aOutputSize.Width() * m_aSplitWin.GetItemSize(TASKPANE_ID) / 100;
|
2007-07-09 10:56:41 +00:00
|
|
|
long nMinWidth = static_cast<long>(0.1*aOutputSize.Width());
|
|
|
|
if ( m_pPropWin && m_pPropWin->IsVisible() )
|
|
|
|
nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
|
|
|
|
|
2008-08-19 09:16:24 +00:00
|
|
|
if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow.getMaxMarkerWidth(sal_False) )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-06-25 10:36:51 +00:00
|
|
|
long nOldSplitPos = getController().getSplitPos();
|
|
|
|
getController().setSplitPos(nTest);
|
2008-01-29 12:50:32 +00:00
|
|
|
if ( nOldSplitPos != -1 && nOldSplitPos <= nTest )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
Invalidate(/*INVALIDATE_NOCHILDREN*/);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
2008-08-19 09:16:24 +00:00
|
|
|
void ODesignView::SelectAll(const sal_uInt16 _nObjectType)
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.SelectAll(_nObjectType);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::unmarkAllObjects(OSectionView* _pSectionView)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.unmarkAllObjects(_pSectionView);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::togglePropertyBrowser(sal_Bool _bToogleOn)
|
|
|
|
{
|
|
|
|
if ( !m_pPropWin && _bToogleOn )
|
|
|
|
{
|
2008-06-25 10:36:51 +00:00
|
|
|
m_pPropWin = new PropBrw(getController().getORB(),m_pTaskPane,this);
|
2008-01-29 12:50:32 +00:00
|
|
|
m_pPropWin->Invalidate();
|
|
|
|
static_cast<OTaskWindow*>(m_pTaskPane)->setPropertyBrowser(m_pPropWin);
|
2007-07-09 10:56:41 +00:00
|
|
|
notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::AddWindow));
|
|
|
|
}
|
|
|
|
if ( m_pPropWin && _bToogleOn != m_pPropWin->IsVisible() )
|
|
|
|
{
|
|
|
|
if ( !m_pCurrentView && !m_xReportComponent.is() )
|
2008-06-25 10:36:51 +00:00
|
|
|
m_xReportComponent = getController().getReportDefinition();
|
2007-07-09 10:56:41 +00:00
|
|
|
|
|
|
|
const sal_Bool bWillBeVisible = _bToogleOn;
|
|
|
|
m_pPropWin->Show(bWillBeVisible);
|
|
|
|
m_pTaskPane->Show(bWillBeVisible);
|
2008-01-29 12:50:32 +00:00
|
|
|
m_pTaskPane->Invalidate();
|
|
|
|
|
|
|
|
if ( bWillBeVisible )
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE/*|SWIB_COLSET */);
|
2008-01-29 12:50:32 +00:00
|
|
|
else
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aSplitWin.RemoveItem(TASKPANE_ID);
|
2008-01-29 12:50:32 +00:00
|
|
|
|
2008-08-19 09:16:24 +00:00
|
|
|
// TRY
|
|
|
|
// Invalidate(/*INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE*/);
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( bWillBeVisible )
|
|
|
|
m_aMarkTimer.Start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xReportComponent)
|
|
|
|
{
|
|
|
|
if ( m_xReportComponent != _xReportComponent )
|
|
|
|
{
|
|
|
|
m_xReportComponent = _xReportComponent;
|
|
|
|
if ( m_pCurrentView )
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.setMarked(m_pCurrentView,sal_False);
|
2007-07-09 10:56:41 +00:00
|
|
|
m_pCurrentView = NULL;
|
|
|
|
m_aMarkTimer.Start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
BOOL ODesignView::isReportExplorerVisible() const
|
|
|
|
{
|
|
|
|
return m_pReportExplorer && m_pReportExplorer->IsVisible();
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::toggleReportExplorer()
|
|
|
|
{
|
|
|
|
if ( !m_pReportExplorer )
|
|
|
|
{
|
2008-06-25 10:36:51 +00:00
|
|
|
OReportController& rReportController = getController();
|
2008-08-19 09:16:24 +00:00
|
|
|
m_pReportExplorer = new ONavigator(this,rReportController);
|
2008-12-09 07:25:38 +00:00
|
|
|
SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) );
|
|
|
|
if ( aDlgOpt.Exists() )
|
|
|
|
m_pReportExplorer->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
|
2008-06-25 10:36:51 +00:00
|
|
|
m_pReportExplorer->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl));
|
2007-07-09 10:56:41 +00:00
|
|
|
notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::AddWindow));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
m_pReportExplorer->Show(!m_pReportExplorer->IsVisible());
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
BOOL ODesignView::isAddFieldVisible() const
|
|
|
|
{
|
|
|
|
return m_pAddField && m_pAddField->IsVisible();
|
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void ODesignView::toggleAddField()
|
|
|
|
{
|
|
|
|
if ( !m_pAddField )
|
|
|
|
{
|
|
|
|
uno::Reference< report::XReportDefinition > xReport(m_xReportComponent,uno::UNO_QUERY);
|
|
|
|
uno::Reference< report::XReportComponent > xReportComponent(m_xReportComponent,uno::UNO_QUERY);
|
2008-06-25 10:36:51 +00:00
|
|
|
OReportController& rReportController = getController();
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( !m_pCurrentView && !xReport.is() )
|
|
|
|
{
|
|
|
|
if ( xReportComponent.is() )
|
|
|
|
xReport = xReportComponent->getSection()->getReportDefinition();
|
|
|
|
else
|
2008-06-25 10:36:51 +00:00
|
|
|
xReport = rReportController.getReportDefinition().get();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
else if ( m_pCurrentView )
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
uno::Reference< report::XSection > xSection = m_pCurrentView->getReportSection()->getSection();
|
2007-07-09 10:56:41 +00:00
|
|
|
xReport = xSection->getReportDefinition();
|
|
|
|
}
|
2009-01-09 12:44:15 +00:00
|
|
|
uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
|
|
|
|
m_pAddField = new OAddFieldWindow(this,xSet);
|
2008-12-10 13:41:25 +00:00
|
|
|
m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) );
|
2009-01-09 12:44:15 +00:00
|
|
|
SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) );
|
|
|
|
if ( aDlgOpt.Exists() )
|
|
|
|
m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
|
2007-07-09 10:56:41 +00:00
|
|
|
m_pAddField->Update();
|
2008-06-25 10:36:51 +00:00
|
|
|
m_pAddField->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl));
|
2007-07-09 10:56:41 +00:00
|
|
|
notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::AddWindow));
|
2008-12-10 13:41:25 +00:00
|
|
|
m_pAddField->Show();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
m_pAddField->Show(!m_pAddField->IsVisible());
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
uno::Reference< report::XSection > ODesignView::getCurrentSection() const
|
|
|
|
{
|
|
|
|
uno::Reference< report::XSection > xSection;
|
|
|
|
if ( m_pCurrentView )
|
2008-08-19 09:16:24 +00:00
|
|
|
xSection = m_pCurrentView->getReportSection()->getSection();
|
2007-07-09 10:56:41 +00:00
|
|
|
|
|
|
|
// why do we need the code below?
|
|
|
|
//else
|
|
|
|
// {
|
2008-06-25 10:36:51 +00:00
|
|
|
// OReportController& rReportController = getController();
|
|
|
|
// xSection = rReportController.getReportDefinition()->getDetail();
|
2007-07-09 10:56:41 +00:00
|
|
|
// }
|
|
|
|
return xSection;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel() const
|
|
|
|
{
|
|
|
|
uno::Reference< report::XReportComponent > xModel;
|
|
|
|
if ( m_pCurrentView )
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
xModel = m_pCurrentView->getReportSection()->getCurrentControlModel();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
return xModel;
|
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
2008-08-19 09:16:24 +00:00
|
|
|
::boost::shared_ptr<OSectionWindow> ODesignView::getMarkedSection(NearSectionAccess nsa) const
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.getMarkedSection(nsa);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
void ODesignView::markSection(const sal_uInt16 _nPos)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.markSection(_nPos);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.fillCollapsedSections(_rCollapsedPositions);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.collapseSections(_aCollpasedSections);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
::rtl::OUString ODesignView::getCurrentPage() const
|
|
|
|
{
|
|
|
|
return m_pPropWin ? m_pPropWin->getCurrentPage() : ::rtl::OUString();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::setCurrentPage(const ::rtl::OUString& _sLastActivePage)
|
|
|
|
{
|
|
|
|
if ( m_pPropWin )
|
|
|
|
m_pPropWin->setCurrentPage(_sLastActivePage);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool ODesignView::isAlignPossible() const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection();
|
|
|
|
return pMarkedSection.get() && pMarkedSection->getReportSection().getSectionView().IsAlignPossible();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
2008-08-19 09:16:24 +00:00
|
|
|
//------------------------------------------------------------------------------
|
2007-07-09 10:56:41 +00:00
|
|
|
sal_Bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
|
|
|
|
{
|
|
|
|
if ( (m_pPropWin && m_pPropWin->HasChildPathFocus()) )
|
|
|
|
return sal_False;
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.handleKeyEvent(_rEvent);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.setMarked(_xSection,_bMark);
|
|
|
|
if ( _bMark )
|
|
|
|
UpdatePropertyBrowserDelayed(getMarkedSection()->getReportSection().getSectionView());
|
|
|
|
else
|
|
|
|
m_pCurrentView = NULL;
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,sal_Bool _bMark)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.setMarked(_aShapes,_bMark);
|
|
|
|
if ( _aShapes.hasElements() && _bMark )
|
|
|
|
showProperties(_aShapes[0]);
|
|
|
|
else
|
|
|
|
m_xReportComponent.clear();
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODesignView::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
if ( rMEvt.IsLeft() )
|
|
|
|
{
|
|
|
|
const uno::Sequence< beans::PropertyValue> aArgs;
|
2008-06-25 10:36:51 +00:00
|
|
|
getController().executeChecked(SID_SELECT_REPORT,aArgs);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
ODataView::MouseButtonDown(rMEvt);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
uno::Any ODesignView::getCurrentlyShownProperty() const
|
|
|
|
{
|
|
|
|
uno::Any aRet;
|
2008-08-19 09:16:24 +00:00
|
|
|
::boost::shared_ptr<OSectionWindow> pSectionWindow = getMarkedSection();
|
|
|
|
if ( pSectionWindow )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2008-06-16 12:45:01 +00:00
|
|
|
::std::vector< uno::Reference< uno::XInterface > > aSelection;
|
2008-08-19 09:16:24 +00:00
|
|
|
pSectionWindow->getReportSection().fillControlModelSelection(aSelection);
|
2007-07-09 10:56:41 +00:00
|
|
|
if ( !aSelection.empty() )
|
2008-06-16 12:45:01 +00:00
|
|
|
{
|
|
|
|
::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
|
|
|
|
uno::Sequence< uno::Reference< report::XReportComponent > > aSeq(aSelection.size());
|
|
|
|
for(sal_Int32 i = 0; i < aSeq.getLength(); ++i,++aIter)
|
|
|
|
{
|
|
|
|
aSeq[i].set(*aIter,uno::UNO_QUERY);
|
|
|
|
}
|
|
|
|
aRet <<= aSeq;
|
|
|
|
}
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2008-06-16 12:45:01 +00:00
|
|
|
void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.fillControlModelSelection(_rSelection);
|
2008-06-16 12:45:01 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2007-07-09 10:56:41 +00:00
|
|
|
void ODesignView::setGridSnap(BOOL bOn)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.setGridSnap(bOn);
|
2007-07-09 10:56:41 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODesignView::setDragStripes(BOOL bOn)
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
m_aScrollWindow.setDragStripes(bOn);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
|
|
|
|
{
|
|
|
|
return m_pPropWin && m_pPropWin->HasChildPathFocus();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_uInt32 ODesignView::getMarkedObjectCount() const
|
|
|
|
{
|
2008-08-19 09:16:24 +00:00
|
|
|
return m_aScrollWindow.getMarkedObjectCount();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2009-01-09 12:44:15 +00:00
|
|
|
void ODesignView::zoom(const Fraction& _aZoom)
|
2008-08-19 09:16:24 +00:00
|
|
|
{
|
2009-01-09 12:44:15 +00:00
|
|
|
m_aScrollWindow.zoom(_aZoom);
|
2008-12-01 12:31:27 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2009-01-09 12:44:15 +00:00
|
|
|
sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const
|
2008-12-01 12:31:27 +00:00
|
|
|
{
|
2009-01-09 12:44:15 +00:00
|
|
|
return m_aScrollWindow.getZoomFactor(_eType);
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
//============================================================================
|
|
|
|
} // rptui
|
|
|
|
//============================================================================
|