summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2009-08-10 17:14:29 +0000
committerThomas Benisch <tbe@openoffice.org>2009-08-10 17:14:29 +0000
commitcce580a22da12760296719e4a7156992ddee9c00 (patch)
treeb3e0bb2e3597c88734d75179f991d159ffb843d1
parent7126ee64eca228d79c5fde3a1c573d2aacb3e672 (diff)
#i12587# Inserting/editing arbitrary text objects in chart
-rw-r--r--chart2/source/controller/inc/ShapeController.hrc5
-rw-r--r--chart2/source/controller/main/ChartController.hxx1
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx149
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx4
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx83
-rw-r--r--chart2/source/controller/main/ChartTransferable.hxx6
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx25
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx6
-rw-r--r--chart2/source/controller/main/ShapeController.hxx2
-rw-r--r--chart2/source/controller/menus/ShapeContextMenu.src10
-rw-r--r--chart2/source/controller/menus/ShapeEditContextMenu.src10
-rw-r--r--chart2/source/inc/ObjectIdentifier.hxx1
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx22
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx2
14 files changed, 242 insertions, 84 deletions
diff --git a/chart2/source/controller/inc/ShapeController.hrc b/chart2/source/controller/inc/ShapeController.hrc
index e263c4d04dde..612c85dee3d8 100644
--- a/chart2/source/controller/inc/ShapeController.hrc
+++ b/chart2/source/controller/inc/ShapeController.hrc
@@ -38,7 +38,10 @@
#define COMMAND_ID_TRANSFORM_DIALOG 4
#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5
#define COMMAND_ID_RENAME_OBJECT 6
-#define COMMAND_ID_FONT_DIALOG 7
+#define COMMAND_ID_CUT 7
+#define COMMAND_ID_COPY 8
+#define COMMAND_ID_PASTE 9
+#define COMMAND_ID_FONT_DIALOG 10
// CHART_SHAPECONTROLLER_HRC
#endif
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index b148fc32d505..3473148e5f0b 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -693,6 +693,7 @@ private:
void impl_PasteGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > & xGraphic,
const ::Point & aPosition );
+ void impl_PasteShapes( SdrModel* pModel );
void impl_SetMousePointer( const MouseEvent & rEvent );
void impl_ClearSelection();
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 5dfdd4d9132c..dfccdb00b6f7 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -62,8 +62,6 @@
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
-// #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
-
#include <svx/ActionDescriptionProvider.hxx>
// for TransferableDataHelper/TransferableHelper
#include <svtools/transfer.hxx>
@@ -82,6 +80,12 @@
#include <vos/mutex.hxx>
// for OutlinerView
#include <svx/outliner.hxx>
+#include <svx/svditer.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unoapi.hxx>
+#include <svx/unopage.hxx>
+
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -337,22 +341,21 @@ void ChartController::executeDispatch_Paste()
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( m_pChartWindow ));
if( aDataHelper.GetTransferable().is())
{
-// if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ))
-// {
-// SotStorageStreamRef xStm;
-// if( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ))
-// {
-// xStm->Seek( 0 );
-// uno::Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ));
-// SdrModel * pModel = new SdrModel();
-// DrawModelWrapper * pDrawModelWrapper( this->GetDrawModelWrapper());
-// if( SvxDrawingLayerImport( pModel, xInputStream ))
-// lcl_CopyShapesToChart( *pModel, m_pDrawModelWrapper->getSdrModel());
-// delete pModel;
-// }
-// }
-// else
- if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ))
+ if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_DRAWING ) )
+ {
+ SotStorageStreamRef xStm;
+ if ( aDataHelper.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStm ) )
+ {
+ xStm->Seek( 0 );
+ Reference< io::XInputStream > xInputStream( new utl::OInputStreamWrapper( *xStm ) );
+ ::boost::scoped_ptr< SdrModel > spModel( new SdrModel() );
+ if ( SvxDrawingLayerImport( spModel.get(), xInputStream ) )
+ {
+ impl_PasteShapes( spModel.get() );
+ }
+ }
+ }
+ else if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_SVXB ) )
{
// graphic exchange format (graphic manager bitmap format?)
SotStorageStreamRef xStm;
@@ -462,33 +465,98 @@ void ChartController::impl_PasteGraphic(
}
}
-void ChartController::executeDispatch_Copy()
+void ChartController::impl_PasteShapes( SdrModel* pModel )
{
-
- Reference< datatransfer::XTransferable > xTransferable;
-
+ DrawModelWrapper* pDrawModelWrapper( this->GetDrawModelWrapper() );
+ if ( pDrawModelWrapper )
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- SdrObject * pSelectedObj = 0;
- if( m_pDrawViewWrapper && m_pDrawModelWrapper )
+ Reference< drawing::XDrawPage > xDestPage( pDrawModelWrapper->getMainDrawPage() );
+ SdrPage* pDestPage = GetSdrPageFromXDrawPage( xDestPage );
+ if ( pDestPage )
{
- if( m_aSelection.getSelectedCID().getLength() )
- pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( m_aSelection.getSelectedCID() );
- else
- pSelectedObj = DrawViewWrapper::getSdrObject( m_aSelection.getSelectedAdditionalShape() );
+ Reference< drawing::XShape > xSelShape;
+ sal_uInt16 nCount = pModel->GetPageCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ const SdrPage* pPage = pModel->GetPage( i );
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pObj = aIter.Next();
+ SdrObject* pNewObj = ( pObj ? pObj->Clone() : NULL );
+ if ( pNewObj )
+ {
+ pNewObj->SetModel( &pDrawModelWrapper->getSdrModel() );
+ pNewObj->SetPage( pDestPage );
+
+ // set position
+ Reference< drawing::XShape > xShape( pNewObj->getUnoShape(), uno::UNO_QUERY );
+ if ( xShape.is() )
+ {
+ xShape->setPosition( awt::Point( 0, 0 ) );
+ }
+
+ pDestPage->InsertObject( pNewObj );
+ xSelShape = xShape;
+ }
+ }
+ }
- if( pSelectedObj )
+ Reference< util::XModifiable > xModifiable( m_aModel->getModel(), uno::UNO_QUERY );
+ if ( xModifiable.is() )
{
- xTransferable = Reference< datatransfer::XTransferable >( new ChartTransferable(
- & m_pDrawModelWrapper->getSdrModel(), pSelectedObj ));
+ xModifiable->setModified( true );
}
+
+ // select last inserted shape
+ m_aSelection.setSelection( xSelShape );
+ m_aSelection.applySelection( m_pDrawViewWrapper );
}
}
- if( xTransferable.is() )
+}
+
+void ChartController::executeDispatch_Copy()
+{
+ if ( m_pDrawViewWrapper )
{
- Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard());
- if( xClipboard.is())
- xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
+ OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
+ if ( pOutlinerView )
+ {
+ pOutlinerView->Copy();
+ }
+ else
+ {
+ Reference< datatransfer::XTransferable > xTransferable;
+ {
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SdrObject* pSelectedObj = 0;
+ if ( m_pDrawModelWrapper )
+ {
+ ObjectIdentifier aSelOID( m_aSelection.getSelectedOID() );
+ if ( aSelOID.isAutoGeneratedObject() )
+ {
+ pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( aSelOID.getObjectCID() );
+ }
+ else if ( aSelOID.isAdditionalShape() )
+ {
+ pSelectedObj = DrawViewWrapper::getSdrObject( aSelOID.getAdditionalShape() );
+ }
+ if ( pSelectedObj )
+ {
+ xTransferable = Reference< datatransfer::XTransferable >( new ChartTransferable(
+ &m_pDrawModelWrapper->getSdrModel(), pSelectedObj, aSelOID.isAdditionalShape() ) );
+ }
+ }
+ }
+ if ( xTransferable.is() )
+ {
+ Reference< datatransfer::clipboard::XClipboard > xClipboard( TransferableHelper::GetSystemClipboard() );
+ if ( xClipboard.is() )
+ {
+ xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
+ }
+ }
+ }
}
}
@@ -501,9 +569,10 @@ void ChartController::executeDispatch_Cut()
//static
bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
{
- OUString aSelObjCID;
- if( (rSelection >>= aSelObjCID) && aSelObjCID.getLength() > 0 )
+ ObjectIdentifier aSelOID( rSelection );
+ if ( aSelOID.isAutoGeneratedObject() )
{
+ OUString aSelObjCID( aSelOID.getObjectCID() );
ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
if( (OBJECTTYPE_TITLE == aObjectType) || (OBJECTTYPE_LEGEND == aObjectType)
|| (OBJECTTYPE_DATA_SERIES == aObjectType) )
@@ -516,6 +585,10 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection )
if( (OBJECTTYPE_DATA_LABELS == aObjectType) || (OBJECTTYPE_DATA_LABEL == aObjectType) )
return true;
}
+ else if ( aSelOID.isAdditionalShape() )
+ {
+ return true;
+ }
return false;
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 94a184fe54e6..b5f721909fdc 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1596,7 +1596,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
aMousePos, pWindow, nModifier, bLeftDown );
bool bForceArrowPointer = false;
- ::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
+ ObjectIdentifier aOID( m_aSelection.getSelectedOID() );
switch( aPointer.GetStyle())
{
@@ -1612,7 +1612,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
bForceArrowPointer = true;
break;
case POINTER_MOVE:
- if( ! ObjectIdentifier::isDragableObject( aObjectCID ))
+ if ( !aOID.isDragableObject() )
bForceArrowPointer = true;
break;
case POINTER_MOVEPOINT:
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index b1caca405dda..b46ce2bb5b15 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -33,12 +33,21 @@
#include "ChartTransferable.hxx"
+#include <unotools/streamwrap.hxx>
#include <vcl/graph.hxx>
+#include <svtools/itempool.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/fhgtitem.hxx>
+#include <svx/svditer.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unomodel.hxx>
// header for class SdrView
#include <svx/svdview.hxx>
+#define CHARTTRANSFER_OBJECTTYPE_DRAWMODEL 1
+
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -48,7 +57,9 @@ using ::rtl::OUString;
namespace chart
{
-ChartTransferable::ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelectedObj )
+ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing )
+ :m_pMarkedObjModel( NULL )
+ ,m_bDrawing( bDrawing )
{
SdrExchangeView * pExchgView( new SdrView( pDrawModel ));
SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 ));
@@ -58,6 +69,10 @@ ChartTransferable::ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelect
pExchgView->MarkAllObj( pPv );
Graphic aGraphic( pExchgView->GetMarkedObjMetaFile( TRUE ));
m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
+ if ( m_bDrawing )
+ {
+ m_pMarkedObjModel = ( pExchgView ? pExchgView->GetAllMarkedModel() : NULL );
+ }
delete pExchgView;
}
@@ -66,6 +81,10 @@ ChartTransferable::~ChartTransferable()
void ChartTransferable::AddSupportedFormats()
{
+ if ( m_bDrawing )
+ {
+ AddFormat( SOT_FORMATSTR_ID_DRAWING );
+ }
AddFormat( SOT_FORMAT_GDIMETAFILE );
AddFormat( SOT_FORMAT_BITMAP );
}
@@ -77,7 +96,11 @@ sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataF
if( HasFormat( nFormat ))
{
- if( nFormat == FORMAT_GDIMETAFILE )
+ if ( nFormat == SOT_FORMATSTR_ID_DRAWING )
+ {
+ bResult = SetObject( m_pMarkedObjModel, CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
+ }
+ else if ( nFormat == FORMAT_GDIMETAFILE )
{
Graphic aGraphic( m_xMetaFileGraphic );
bResult = SetGDIMetaFile( aGraphic.GetGDIMetaFile(), rFlavor );
@@ -92,5 +115,61 @@ sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataF
return bResult;
}
+sal_Bool ChartTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+ const datatransfer::DataFlavor& /* rFlavor */ )
+{
+ // called from SetObject, put data into stream
+
+ sal_Bool bRet = sal_False;
+ switch ( nUserObjectId )
+ {
+ case CHARTTRANSFER_OBJECTTYPE_DRAWMODEL:
+ {
+ SdrModel* pMarkedObjModel = reinterpret_cast< SdrModel* >( pUserObject );
+ if ( pMarkedObjModel )
+ {
+ rxOStm->SetBufferSize( 0xff00 );
+
+ // #108584#
+ // for the changed pool defaults from drawing layer pool set those
+ // attributes as hard attributes to preserve them for saving
+ const SfxItemPool& rItemPool = pMarkedObjModel->GetItemPool();
+ const SvxFontHeightItem& rDefaultFontHeight = static_cast< const SvxFontHeightItem& >(
+ rItemPool.GetDefaultItem( EE_CHAR_FONTHEIGHT ) );
+ sal_uInt16 nCount = pMarkedObjModel->GetPageCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ const SdrPage* pPage = pMarkedObjModel->GetPage( i );
+ SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS );
+ while ( aIter.IsMore() )
+ {
+ SdrObject* pObj = aIter.Next();
+ const SvxFontHeightItem& rItem = static_cast< const SvxFontHeightItem& >(
+ pObj->GetMergedItem( EE_CHAR_FONTHEIGHT ) );
+ if ( rItem.GetHeight() == rDefaultFontHeight.GetHeight() )
+ {
+ pObj->SetMergedItem( rDefaultFontHeight );
+ }
+ }
+ }
+
+ Reference< io::XOutputStream > xDocOut( new utl::OOutputStreamWrapper( *rxOStm ) );
+ if ( SvxDrawingLayerExport( pMarkedObjModel, xDocOut ) )
+ {
+ rxOStm->Commit();
+ }
+
+ bRet = ( rxOStm->GetError() == ERRCODE_NONE );
+ }
+ }
+ break;
+ default:
+ {
+ DBG_ERROR( "ChartTransferable::WriteObject: unknown object id" );
+ }
+ break;
+ }
+ return bRet;
+}
} // namespace chart
diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx
index 114ec38896f8..cfa8e956ea29 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -47,7 +47,7 @@ namespace chart
class ChartTransferable : public TransferableHelper
{
public:
- explicit ChartTransferable( SdrModel * pDrawModel, SdrObject * pSelectedObj );
+ explicit ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing = false );
virtual ~ChartTransferable();
protected:
@@ -55,9 +55,13 @@ protected:
// implementation of TransferableHelper methods
virtual void AddSupportedFormats();
virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
private:
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xMetaFileGraphic;
+ SdrModel* m_pMarkedObjModel;
+ bool m_bDrawing;
};
} // namespace chart
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 7531290c9714..39c2dc3544d5 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -167,16 +167,16 @@ void ControllerState::update(
Reference< view::XSelectionSupplier > xSelectionSupplier(
xController, uno::UNO_QUERY );
- OUString aSelObjCID;
-
// Update ControllerState variables.
if( xSelectionSupplier.is())
{
uno::Any aSelObj( xSelectionSupplier->getSelection() );
+ ObjectIdentifier aSelOID( aSelObj );
+ OUString aSelObjCID( aSelOID.getObjectCID() );
- bHasSelectedObject = ((aSelObj >>= aSelObjCID) && aSelObjCID.getLength() > 0);
+ bHasSelectedObject = aSelOID.isValid();
- bIsDraggableObject = ObjectIdentifier::isDragableObject( aSelObjCID );
+ bIsDraggableObject = aSelOID.isDragableObject();
ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
bIsTextObject = OBJECTTYPE_TITLE == aObjectType;
@@ -528,22 +528,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:DiagramWall")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasWall;
m_aCommandAvailability[ C2U(".uno:DiagramArea")] = bIsWritable;
- bool bTransformDialog = false;
- if ( m_pChartController && m_pChartController->isShapeContext() )
- {
- // #i12587# support for shapes in chart
- ShapeController* pShapeController = ( m_pDispatchContainer ? m_pDispatchContainer->getShapeController() : NULL );
- if ( pShapeController )
- {
- FeatureState aFeatureState( pShapeController->getState( C2U( ".uno:TransformDialog" ) ) );
- bTransformDialog = aFeatureState.bEnabled;
- }
- }
- else
- {
- bTransformDialog = ( bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsDraggableObject );
- }
- m_aCommandAvailability[ C2U(".uno:TransformDialog")] = bTransformDialog;
+ m_aCommandAvailability[ C2U(".uno:TransformDialog")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsDraggableObject;
// 3d commands
m_aCommandAvailability[ C2U(".uno:View3D")] = bIsWritable && bModelStateIsValid && m_apModelState->bIsThreeD;
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index 3cd5ec816ba2..8cf8c87b0f18 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -326,11 +326,7 @@ bool Selection::isRotateableObjectSelected( const uno::Reference< frame::XModel
bool Selection::isDragableObjectSelected()
{
- if( m_aSelectedOID.isAutoGeneratedObject() )
- {
- return ObjectIdentifier::isDragableObject( m_aSelectedOID.getObjectCID() );
- }
- return m_aSelectedOID.isAdditionalShape();
+ return m_aSelectedOID.isDragableObject();
}
bool Selection::isAdditionalShapeSelected() const
diff --git a/chart2/source/controller/main/ShapeController.hxx b/chart2/source/controller/main/ShapeController.hxx
index a456d41a3855..134ca9d4dba3 100644
--- a/chart2/source/controller/main/ShapeController.hxx
+++ b/chart2/source/controller/main/ShapeController.hxx
@@ -46,8 +46,6 @@ class ChartController;
*/
class ShapeController: public FeatureCommandDispatchBase
{
- friend class ControllerCommandDispatch;
-
public:
ShapeController( const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
diff --git a/chart2/source/controller/menus/ShapeContextMenu.src b/chart2/source/controller/menus/ShapeContextMenu.src
index 00766969221d..3a8957033199 100644
--- a/chart2/source/controller/menus/ShapeContextMenu.src
+++ b/chart2/source/controller/menus/ShapeContextMenu.src
@@ -30,7 +30,6 @@
#include "MenuResIds.hrc"
#include "ShapeController.hrc"
-#include <svx/globlmn.hrc>
#include <svx/svxids.hrc>
@@ -78,15 +77,18 @@ Menu RID_CONTEXTMENU_SHAPE
};
MenuItem
{
- ITEM_EDIT_CUT
+ Identifier = COMMAND_ID_CUT;
+ Command = ".uno:Cut";
};
MenuItem
{
- ITEM_EDIT_COPY
+ Identifier = COMMAND_ID_COPY;
+ Command = ".uno:Copy";
};
MenuItem
{
- ITEM_EDIT_PASTE
+ Identifier = COMMAND_ID_PASTE;
+ Command = ".uno:Paste";
};
};
};
diff --git a/chart2/source/controller/menus/ShapeEditContextMenu.src b/chart2/source/controller/menus/ShapeEditContextMenu.src
index 794038295f21..dc9b9881f7f6 100644
--- a/chart2/source/controller/menus/ShapeEditContextMenu.src
+++ b/chart2/source/controller/menus/ShapeEditContextMenu.src
@@ -30,7 +30,6 @@
#include "MenuResIds.hrc"
#include "ShapeController.hrc"
-#include <svx/globlmn.hrc>
#include <svx/svxids.hrc>
Menu RID_CONTEXTMENU_SHAPEEDIT
@@ -48,15 +47,18 @@ Menu RID_CONTEXTMENU_SHAPEEDIT
};
MenuItem
{
- ITEM_EDIT_CUT
+ Identifier = COMMAND_ID_CUT;
+ Command = ".uno:Cut";
};
MenuItem
{
- ITEM_EDIT_COPY
+ Identifier = COMMAND_ID_COPY;
+ Command = ".uno:Copy";
};
MenuItem
{
- ITEM_EDIT_PASTE
+ Identifier = COMMAND_ID_PASTE;
+ Command = ".uno:Paste";
};
};
};
diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx
index 3a0a8e18d407..5045199b22cd 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -186,6 +186,7 @@ public:
static rtl::OUString getDragMethodServiceName( const rtl::OUString& rClassifiedIdentifier );
static rtl::OUString getDragParameterString( const rtl::OUString& rCID );
static bool isDragableObject( const rtl::OUString& rClassifiedIdentifier );
+ bool isDragableObject();
static bool isRotateableObject( const rtl::OUString& rClassifiedIdentifier );
static bool isMultiClickObject( const rtl::OUString& rClassifiedIdentifier );
static bool areSiblings( const rtl::OUString& rCID1, const rtl::OUString& rCID2 );//identical object is no sibling
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index c594a52bf281..e41d37c43af6 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -757,6 +757,20 @@ bool ObjectIdentifier::isDragableObject( const OUString& rClassifiedIdentifier )
return false;
}
+bool ObjectIdentifier::isDragableObject()
+{
+ bool bReturn = false;
+ if ( isAutoGeneratedObject() )
+ {
+ bReturn = isDragableObject( m_aObjectCID );
+ }
+ else if ( isAdditionalShape() )
+ {
+ bReturn = true;
+ }
+ return bReturn;
+}
+
//static
bool ObjectIdentifier::isRotateableObject( const OUString& rClassifiedIdentifier )
{
@@ -998,13 +1012,13 @@ ObjectType ObjectIdentifier::getObjectType( const OUString& rCID )
ObjectType ObjectIdentifier::getObjectType()
{
ObjectType eObjectType( OBJECTTYPE_UNKNOWN );
- if ( isAdditionalShape() )
+ if ( isAutoGeneratedObject() )
{
- eObjectType = OBJECTTYPE_SHAPE;
+ eObjectType = getObjectType( m_aObjectCID );
}
- else if ( isAutoGeneratedObject() )
+ else if ( isAdditionalShape() )
{
- eObjectType = getObjectType( m_aObjectCID );
+ eObjectType = OBJECTTYPE_SHAPE;
}
return eObjectType;
}
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 95b5144265ae..3fe9cc690927 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -134,7 +134,7 @@ DrawModelWrapper::DrawModelWrapper(
SetScaleUnit(MAP_100TH_MM);
SetScaleFraction(Fraction(1, 1));
- SetDefaultFontHeight(847); // 24pt
+ SetDefaultFontHeight(423); // 12pt
SfxItemPool* pMasterPool = &GetItemPool();
pMasterPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);