openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1409191 - in /incubator/ooo/trunk/main: chart2/source/model/main/ sc/source/filter/excel/ sc/source/filter/starcalc/ sc/source/ui/drawfunc/ sc/source/ui/unoobj/ sd/source/ui/func/ sd/source/ui/view/ svx/inc/svx/ svx/source/svdraw/ sw/sourc...
Date Wed, 14 Nov 2012 13:24:05 GMT
Author: alg
Date: Wed Nov 14 13:24:03 2012
New Revision: 1409191

URL: http://svn.apache.org/viewvc?rev=1409191&view=rev
Log:
#121334# turbned back chart non-fill defaults, done the non-fill using tooling when chreating
new chart modules

Modified:
    incubator/ooo/trunk/main/chart2/source/model/main/PageBackground.cxx
    incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx
    incubator/ooo/trunk/main/sc/source/filter/starcalc/scfobj.cxx
    incubator/ooo/trunk/main/sc/source/ui/drawfunc/fuins2.cxx
    incubator/ooo/trunk/main/sc/source/ui/unoobj/chartuno.cxx
    incubator/ooo/trunk/main/sd/source/ui/func/fuinsert.cxx
    incubator/ooo/trunk/main/sd/source/ui/view/viewshe2.cxx
    incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx
    incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx
    incubator/ooo/trunk/main/sw/source/ui/table/tablemgr.cxx

Modified: incubator/ooo/trunk/main/chart2/source/model/main/PageBackground.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/chart2/source/model/main/PageBackground.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/chart2/source/model/main/PageBackground.cxx (original)
+++ incubator/ooo/trunk/main/chart2/source/model/main/PageBackground.cxx Wed Nov 14 13:24:03
2012
@@ -32,7 +32,6 @@
 #include "PropertyHelper.hxx"
 
 #include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/FillStyle.hpp>
 #include <rtl/uuid.h>
 #include <cppuhelper/queryinterface.hxx>
 
@@ -65,9 +64,7 @@ private:
         ::chart::FillProperties::AddDefaultsToMap( rOutMap );
 
         // override other defaults
-        // #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< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR,
0xffffff );
         ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE,
drawing::LineStyle_NONE );
     }    
 };

Modified: incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/excel/xiescher.cxx Wed Nov 14 13:24:03 2012
@@ -75,6 +75,7 @@
 #include <svx/unoapi.hxx>
 #include <svx/svditer.hxx>
 #include <editeng/writingmodeitem.hxx>
+#include <svx/charthelper.hxx>
 
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
@@ -1731,6 +1732,9 @@ SdrObject* XclImpChartObj::DoCreateSdrOb
         ::com::sun::star::awt::Size aAwtSize( aSize.Width(), aSize.Height() );
         xEmbObj->setVisualAreaSize( nAspect, aAwtSize );
 
+        // #121334#
+        ChartHelper::AdaptDefaultsForChart( xEmbObj );
+
         // create the container OLE object
         xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName,
rAnchorRect ) );
     }

Modified: incubator/ooo/trunk/main/sc/source/filter/starcalc/scfobj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/starcalc/scfobj.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/filter/starcalc/scfobj.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/filter/starcalc/scfobj.cxx Wed Nov 14 13:24:03 2012
@@ -41,6 +41,7 @@ using namespace com::sun::star;
 #include <sot/storage.hxx>
 #include <sfx2/app.hxx>
 #include <sot/clsids.hxx>
+#include <svx/charthelper.hxx>
 #include "address.hxx"
 
 #include "scfobj.hxx"
@@ -86,6 +87,9 @@ void Sc10InsertObject::InsertChart( ScDo
         aSz.Height = rRect.GetSize().Height();
         xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, aSz );
 
+        // #121334#
+        ChartHelper::AdaptDefaultsForChart( xObj );
+
 			// hier kann das Chart noch nicht mit Daten gefuettert werden,
 			// weil die Formeln noch nicht berechnet sind.
 			// Deshalb in die ChartCollection, die Daten werden dann im

Modified: incubator/ooo/trunk/main/sc/source/ui/drawfunc/fuins2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/drawfunc/fuins2.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/drawfunc/fuins2.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/drawfunc/fuins2.cxx Wed Nov 14 13:24:03 2012
@@ -51,6 +51,7 @@
 #include <svx/svdpage.hxx>
 #include <svx/svdundo.hxx>
 #include <sfx2/msgpool.hxx>
+#include <svx/charthelper.hxx>
 #include <scmod.hxx>
 
 // BM/IHA --
@@ -665,6 +666,9 @@ FuInsertChart::FuInsertChart(ScTabViewSh
         SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName,
aRect);
         SdrPageView* pPV = pView->GetSdrPageView();
 
+        // #121334#
+        ChartHelper::AdaptDefaultsForChart( xObj );
+
 //        pView->InsertObjectAtView(pObj, *pPV);//this call leads to an immidiate redraw
and asks the chart for a visual representation
 
         // use the page instead of the view to insert, so no undo action is created yet

Modified: incubator/ooo/trunk/main/sc/source/ui/unoobj/chartuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/unoobj/chartuno.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/unoobj/chartuno.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/unoobj/chartuno.cxx Wed Nov 14 13:24:03 2012
@@ -39,6 +39,7 @@
 #include <unotools/moduleoptions.hxx>
 #include <sot/clsids.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <svx/charthelper.hxx>
 
 #include "chartuno.hxx"
 #include "miscuno.hxx"
@@ -291,6 +292,9 @@ void SAL_CALL ScChartsObj::addNewByName(
             if( xObj.is())
                 xObj->setVisualAreaSize( nAspect, aSz );
 
+            // #121334#
+            ChartHelper::AdaptDefaultsForChart( xObj );
+
 			pPage->InsertObject( pObj );
             pModel->AddUndo( new SdrUndoNewObj( *pObj ) );
 

Modified: incubator/ooo/trunk/main/sd/source/ui/func/fuinsert.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/func/fuinsert.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/func/fuinsert.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/func/fuinsert.cxx Wed Nov 14 13:24:03 2012
@@ -71,8 +71,8 @@
 #include <vcl/msgbox.hxx>
 #endif
 #include <sfx2/opengrf.hxx>
-
 #include <sfx2/viewfrm.hxx>
+#include <svx/charthelper.hxx>
 
 #include "app.hrc"
 #include "misc.hxx"
@@ -394,6 +394,14 @@ void FuInsertOLE::DoExecute( SfxRequest&
                 aVisualSize.Height = aTmp.Height();
                 xObj->setVisualAreaSize( nAspect, aVisualSize );
                 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.
+                    ChartHelper::AdaptDefaultsForChart( xObj );
+                }
 			}
 		}
 		else

Modified: incubator/ooo/trunk/main/sd/source/ui/view/viewshe2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/view/viewshe2.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/view/viewshe2.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/view/viewshe2.cxx Wed Nov 14 13:24:03 2012
@@ -83,6 +83,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <svtools/soerr.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
+#include <svx/charthelper.hxx>
 
 #ifdef _MSC_VER
 #pragma optimize ( "", off )
@@ -832,6 +833,7 @@ sal_Bool ViewShell::ActivateObject(SdrOl
 	GetDocSh()->SetWaitCursor( sal_True );
     SfxViewShell* pViewShell = GetViewShell();
     OSL_ASSERT (pViewShell!=NULL);
+    bool bChangeDefaultsForChart = false;
 
     uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
     if ( !xObj.is() )
@@ -848,6 +850,7 @@ sal_Bool ViewShell::ActivateObject(SdrOl
 			if( SvtModuleOptions().IsChart() )
             {
                 aClass = SvGlobalName( SO3_SCH_CLASSID );
+                bChangeDefaultsForChart = true;
             }
 		}
 		else if( aName.EqualsAscii( "StarCalc" ))
@@ -972,6 +975,11 @@ sal_Bool ViewShell::ActivateObject(SdrOl
 		// the object area size must be set after scaling, since it triggers the resizing
         pSdClient->SetObjArea(aRect);
 
+        if( bChangeDefaultsForChart && xObj.is())
+        {
+            ChartHelper::AdaptDefaultsForChart( xObj );
+        }
+
         pSdClient->DoVerb(nVerb);   // ErrCode wird ggf. vom Sfx ausgegeben
 		pViewShell->GetViewFrame()->GetBindings().Invalidate(
             SID_NAVIGATOR_STATE, sal_True, sal_False);

Modified: incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx (original)
+++ incubator/ooo/trunk/main/svx/inc/svx/charthelper.hxx Wed Nov 14 13:24:03 2012
@@ -27,6 +27,7 @@
 #include <basegfx/range/b2drange.hxx>
 #include <svx/svxdllapi.h>
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 // predeclarations
@@ -48,6 +49,17 @@ public:
     static drawinglayer::primitive2d::Primitive2DSequence tryToGetChartContentAsPrimitive2DSequence(
         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >&
rXModel,
         basegfx::B2DRange& rRange);
+
+    // #121334# Allow to switch off line and fill style by setting these as attributes
+    // at the OLE chart object. This is needed to allow fill styles of the covering objects
+    // to make their own fill/line settings work. This should not be done by changing
+    // the defaults at the chart (see StaticPageBackgroundDefaults_Initializer::lcl_AddDefaultsToMap)
+    // since this would not be saved/loaded, thus the compatibility will be better when setting
it at
+    // newly created charts using this method
+    static void AdaptDefaultsForChart(
+        const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject
> & xEmbObj,
+        bool bNoFillStyle = true,
+        bool bNoLineStyle = true);
 };
 
 //////////////////////////////////////////////////////////////////////////////

Modified: incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/charthelper.cxx Wed Nov 14 13:24:03 2012
@@ -33,14 +33,9 @@
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
 #include <drawinglayer/geometry/viewinformation2d.hxx>
-
-//// header for function rtl_createUuid
-//#include <rtl/uuid.h>
-//#include <vcl/pdfextoutdevdata.hxx>
-//
-//#include <com/sun/star/lang/XUnoTunnel.hpp>
-//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-//#include <svtools/embedhlp.hxx>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -139,5 +134,36 @@ drawinglayer::primitive2d::Primitive2DSe
     return aRetval;
 }
 
+void ChartHelper::AdaptDefaultsForChart(
+    const uno::Reference < embed::XEmbeddedObject > & xEmbObj,
+    bool bNoFillStyle,
+    bool bNoLineStyle)
+{
+    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" );
+        }
+    }
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // eof

Modified: incubator/ooo/trunk/main/sw/source/ui/table/tablemgr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/table/tablemgr.cxx?rev=1409191&r1=1409190&r2=1409191&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/table/tablemgr.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/table/tablemgr.cxx Wed Nov 14 13:24:03 2012
@@ -31,6 +31,7 @@
 
 #include <sot/storage.hxx>
 #include <sot/clsids.hxx>
+#include <svx/charthelper.hxx>
 
 #include "edtwin.hxx"
 #include "errhdl.hxx"
@@ -278,6 +279,9 @@ uno::Reference< frame::XModel > SwTableF
         //DoVerb in der SfxViewShell
         ErrCode nErr = pClient->DoVerb( SVVERB_SHOW );
 		(void) nErr;
+
+        // #121334#
+        ChartHelper::AdaptDefaultsForChart( xObj );
 	}
 
     uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xChartModel, uno::UNO_QUERY
);



Mime
View raw message