Kaydet (Commit) 0050a8e4 authored tarafından Armin Le Grand's avatar Armin Le Grand

#121334# Changed default for charts background to be none (from white) to allow…

#121334# Changed default for charts background to be none (from white) to allow fill settings in the various apps to have an effect
üst 20a3aee5
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "PropertyHelper.hxx" #include "PropertyHelper.hxx"
#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <rtl/uuid.h> #include <rtl/uuid.h>
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
...@@ -64,7 +65,9 @@ private: ...@@ -64,7 +65,9 @@ private:
::chart::FillProperties::AddDefaultsToMap( rOutMap ); ::chart::FillProperties::AddDefaultsToMap( rOutMap );
// override other defaults // override other defaults
::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // #121334# As default, do not fill the chart page background; we want to be able to have the background
// of the object containing the chart to define this background fill (evtl. with different methodologies)
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE ); ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
} }
}; };
......
...@@ -89,8 +89,6 @@ using namespace ::com::sun::star; ...@@ -89,8 +89,6 @@ using namespace ::com::sun::star;
#include "globstr.hrc" #include "globstr.hrc"
#include "drawview.hxx" #include "drawview.hxx"
extern SdrObject* pSkipPaintObj; // output.cxx - dieses Objekt nicht zeichnen
//------------------------------------------------------------------------ //------------------------------------------------------------------------
#define IS_AVAILABLE(WhichId,ppItem) \ #define IS_AVAILABLE(WhichId,ppItem) \
...@@ -385,12 +383,6 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie ...@@ -385,12 +383,6 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
aPnt.X() -= aSize.Width(); // move position to left edge aPnt.X() -= aSize.Width(); // move position to left edge
Rectangle aRect (aPnt, aSize); Rectangle aRect (aPnt, aSize);
SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
// Dieses Objekt nicht vor dem Aktivieren zeichnen
// (in MarkListHasChanged kommt ein Update)
if (!bIsFromFile)
pSkipPaintObj = pObj;
SdrPageView* pPV = pView->GetSdrPageView(); SdrPageView* pPV = pView->GetSdrPageView();
pView->InsertObjectAtView(pObj, *pPV); pView->InsertObjectAtView(pObj, *pPV);
...@@ -428,7 +420,6 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie ...@@ -428,7 +420,6 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pVie
else else
{ {
pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW ); pViewShell->ActivateObject( (SdrOle2Obj*) pObj, SVVERB_SHOW );
pSkipPaintObj = NULL;
} }
} }
...@@ -672,11 +663,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* ...@@ -672,11 +663,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
Rectangle aRect (aStart, aSize); Rectangle aRect (aStart, aSize);
SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect); SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
// Dieses Objekt nicht vor dem Aktivieren zeichnen
// (in MarkListHasChanged kommt ein Update)
pSkipPaintObj = pObj;
SdrPageView* pPV = pView->GetSdrPageView(); SdrPageView* pPV = pView->GetSdrPageView();
// pView->InsertObjectAtView(pObj, *pPV);//this call leads to an immidiate redraw and asks the chart for a visual representation // pView->InsertObjectAtView(pObj, *pPV);//this call leads to an immidiate redraw and asks the chart for a visual representation
......
...@@ -45,10 +45,6 @@ ...@@ -45,10 +45,6 @@
#include <svx/fmview.hxx> #include <svx/fmview.hxx>
// STATIC DATA -----------------------------------------------------------
SdrObject* pSkipPaintObj = NULL;
//================================================================== //==================================================================
// #i72502# // #i72502#
......
...@@ -394,14 +394,6 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) ...@@ -394,14 +394,6 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
aVisualSize.Height = aTmp.Height(); aVisualSize.Height = aTmp.Height();
xObj->setVisualAreaSize( nAspect, aVisualSize ); xObj->setVisualAreaSize( nAspect, aVisualSize );
mpViewShell->ActivateObject(pOleObj, SVVERB_SHOW); mpViewShell->ActivateObject(pOleObj, SVVERB_SHOW);
if (nSlotId == SID_INSERT_DIAGRAM)
{
// note, that this call modified the chart model which
// results in a change notification. So call this after
// everything else is finished.
mpViewShell->AdaptDefaultsForChart( xObj );
}
} }
} }
else else
......
...@@ -434,9 +434,6 @@ public: ...@@ -434,9 +434,6 @@ public:
*/ */
virtual bool RelocateToParentWindow (::Window* pParentWindow); virtual bool RelocateToParentWindow (::Window* pParentWindow);
void AdaptDefaultsForChart(
const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > & xEmbObj );
/** Depending on the given request create a new page or duplicate an /** Depending on the given request create a new page or duplicate an
existing one. A new page is created behind the given slide. existing one. A new page is created behind the given slide.
@param rRequest @param rRequest
......
...@@ -832,7 +832,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) ...@@ -832,7 +832,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
GetDocSh()->SetWaitCursor( sal_True ); GetDocSh()->SetWaitCursor( sal_True );
SfxViewShell* pViewShell = GetViewShell(); SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=NULL); OSL_ASSERT (pViewShell!=NULL);
bool bChangeDefaultsForChart = false;
uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef(); uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
if ( !xObj.is() ) if ( !xObj.is() )
...@@ -849,7 +848,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) ...@@ -849,7 +848,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
if( SvtModuleOptions().IsChart() ) if( SvtModuleOptions().IsChart() )
{ {
aClass = SvGlobalName( SO3_SCH_CLASSID ); aClass = SvGlobalName( SO3_SCH_CLASSID );
bChangeDefaultsForChart = true;
} }
} }
else if( aName.EqualsAscii( "StarCalc" )) else if( aName.EqualsAscii( "StarCalc" ))
...@@ -974,11 +972,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) ...@@ -974,11 +972,6 @@ sal_Bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
// the object area size must be set after scaling, since it triggers the resizing // the object area size must be set after scaling, since it triggers the resizing
pSdClient->SetObjArea(aRect); pSdClient->SetObjArea(aRect);
if( bChangeDefaultsForChart && xObj.is())
{
AdaptDefaultsForChart( xObj );
}
pSdClient->DoVerb(nVerb); // ErrCode wird ggf. vom Sfx ausgegeben pSdClient->DoVerb(nVerb); // ErrCode wird ggf. vom Sfx ausgegeben
pViewShell->GetViewFrame()->GetBindings().Invalidate( pViewShell->GetViewFrame()->GetBindings().Invalidate(
SID_NAVIGATOR_STATE, sal_True, sal_False); SID_NAVIGATOR_STATE, sal_True, sal_False);
...@@ -1186,33 +1179,4 @@ Point ViewShell::GetViewOrigin() const ...@@ -1186,33 +1179,4 @@ Point ViewShell::GetViewOrigin() const
return mpContentWindow->GetViewOrigin(); return mpContentWindow->GetViewOrigin();
} }
void ViewShell::AdaptDefaultsForChart(
const uno::Reference < embed::XEmbeddedObject > & xEmbObj )
{
if( xEmbObj.is())
{
uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY );
OSL_ENSURE( xChartDoc.is(), "Trying to set chart property to non-chart OLE" );
if( !xChartDoc.is())
return;
try
{
// set background to transparent (none)
uno::Reference< beans::XPropertySet > xPageProp( xChartDoc->getPageBackground());
if( xPageProp.is())
xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FillStyle")),
uno::makeAny( drawing::FillStyle_NONE ));
// set no border
if( xPageProp.is())
xPageProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LineStyle")),
uno::makeAny( drawing::LineStyle_NONE ));
}
catch( const uno::Exception & )
{
OSL_ENSURE( false, "Exception caught in AdaptDefaultsForChart" );
}
}
}
} // end of namespace sd } // end of namespace sd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment