[Libreoffice-commits] core.git: Branch 'feature/perfwork4' - 2 commits - include/svx svx/source

2014-10-29 Thread Kohei Yoshida
 include/svx/sdrpagewindow.hxx   |2 --
 svx/source/svdraw/sdrpagewindow.cxx |   27 +--
 2 files changed, 9 insertions(+), 20 deletions(-)

New commits:
commit dfb613213c0ee0e8ae18dee81f439c24a4cd921a
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Wed Oct 29 23:24:38 2014 -0400

Remove com::sun::star.

Change-Id: Id656f1ef1cdfb695bcfcb35e393def3682e8c556

diff --git a/svx/source/svdraw/sdrpagewindow.cxx 
b/svx/source/svdraw/sdrpagewindow.cxx
index 37ec51b..2fd2ddc 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -72,7 +72,7 @@ struct SdrPageWindow::Impl
 };
 
 
-::com::sun::star::uno::Reference ::com::sun::star::awt::XControlContainer  
SdrPageWindow::GetControlContainer( bool _bCreateIfNecessary ) const
+uno::Referenceawt::XControlContainer SdrPageWindow::GetControlContainer( 
bool _bCreateIfNecessary ) const
 {
 if (!mpImpl-mxControlContainer.is()  _bCreateIfNecessary)
 {
@@ -98,8 +98,7 @@ struct SdrPageWindow::Impl
 uno::Reference uno::XInterface  xContext = 
xControl-getContext();
 if(!xContext.is())
 {
-xControl-createPeer( ::com::sun::star::uno::Reference 
::com::sun::star::awt::XToolkit  (),
-::com::sun::star::uno::Reference 
::com::sun::star::awt::XWindowPeer  () );
+xControl-createPeer( uno::Referenceawt::XToolkit(), 
uno::Referenceawt::XWindowPeer() );
 }
 }
 }
commit ea5939084019960b0aa3ccbf9f43e40ecd74cfc6
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Wed Oct 29 23:21:41 2014 -0400

Remove indirection...

Change-Id: Ia01ed40391a4d5725a9f9e22817406216020c0d2

diff --git a/include/svx/sdrpagewindow.hxx b/include/svx/sdrpagewindow.hxx
index 82c82b0..e7156eb 100644
--- a/include/svx/sdrpagewindow.hxx
+++ b/include/svx/sdrpagewindow.hxx
@@ -51,8 +51,6 @@ class SVX_DLLPUBLIC SdrPageWindow
 
 Impl* mpImpl;
 
-sdr::contact::ObjectContact* CreateViewSpecificObjectContact();
-
 SdrPageWindow( const SdrPageWindow ); // disabled
 SdrPageWindow operator= ( const SdrPageWindow ); // disabled
 
diff --git a/svx/source/svdraw/sdrpagewindow.cxx 
b/svx/source/svdraw/sdrpagewindow.cxx
index 869ff10..37ec51b 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -45,18 +45,18 @@ using namespace ::com::sun::star;
 struct SdrPageWindow::Impl
 {
 // #110094# ObjectContact section
-sdr::contact::ObjectContact*mpObjectContact;
+mutable sdr::contact::ObjectContactOfPageView* mpObjectContact;
 
 // the SdrPageView this window belongs to
-SdrPageViewmrPageView;
+SdrPageView mrPageView;
 
 // the PaintWindow to paint on. Here is access to OutDev etc.
 // #i72752# change to pointer to allow patcing it in DrawLayer() if 
necessary
-SdrPaintWindow* mpPaintWindow;
-SdrPaintWindow* mpOriginalPaintWindow;
+SdrPaintWindow* mpPaintWindow;
+SdrPaintWindow* mpOriginalPaintWindow;
 
 // UNO stuff for xControls
-::com::sun::star::uno::Reference ::com::sun::star::awt::XControlContainer 
 mxControlContainer;
+uno::Referenceawt::XControlContainer mxControlContainer;
 
 Impl( SdrPageView rPageView, SdrPaintWindow rPaintWindow ) :
 mpObjectContact(NULL),
@@ -156,12 +156,6 @@ SdrPageWindow::~SdrPageWindow()
 delete mpImpl;
 }
 
-// ObjectContact section
-sdr::contact::ObjectContact* SdrPageWindow::CreateViewSpecificObjectContact()
-{
-return new sdr::contact::ObjectContactOfPageView(*this);
-}
-
 SdrPageView SdrPageWindow::GetPageView() const
 {
 return mpImpl-mrPageView;
@@ -449,9 +443,7 @@ void SdrPageWindow::InvalidatePageWindow(const 
basegfx::B2DRange rRange)
 const sdr::contact::ObjectContact SdrPageWindow::GetObjectContact() const
 {
 if (!mpImpl-mpObjectContact)
-{
-((SdrPageWindow*)this)-mpImpl-mpObjectContact = 
((SdrPageWindow*)this)-CreateViewSpecificObjectContact();
-}
+mpImpl-mpObjectContact = new 
sdr::contact::ObjectContactOfPageView(const_castSdrPageWindow(*this));
 
 return *mpImpl-mpObjectContact;
 }
@@ -459,7 +451,7 @@ const sdr::contact::ObjectContact 
SdrPageWindow::GetObjectContact() const
 sdr::contact::ObjectContact SdrPageWindow::GetObjectContact()
 {
 if (!mpImpl-mpObjectContact)
-mpImpl-mpObjectContact = CreateViewSpecificObjectContact();
+mpImpl-mpObjectContact = new 
sdr::contact::ObjectContactOfPageView(*this);
 
 return *mpImpl-mpObjectContact;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/perfwork4' - 2 commits - include/svx svx/source

2014-10-28 Thread Kohei Yoshida
 include/svx/sdr/properties/properties.hxx |   11 +
 svx/source/sdr/properties/properties.cxx  |   10 +
 svx/source/unodraw/unoshape.cxx   |  167 ++
 3 files changed, 98 insertions(+), 90 deletions(-)

New commits:
commit 808817a27a7cb43a164dab71838132950bb6025d
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Fri Oct 24 15:23:58 2014 -0400

Make this member private. Nobody accesses it directly.

Change-Id: Id00917198bda71eb80768526375eb83ba46dba11

diff --git a/include/svx/sdr/properties/properties.hxx 
b/include/svx/sdr/properties/properties.hxx
index 4b7e6f2..f0c1065 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -50,19 +50,20 @@ namespace sdr
 {
 class SVX_DLLPUBLIC BaseProperties
 {
-protected:
+private:
 // the owner of this Properties. Set from constructor and not
 // to be changed in any way.
 SdrObject  mrObject;
 
+protected:
+
 // create a new object specific itemset with object specific 
ranges.
 virtual SfxItemSet* CreateObjectSpecificItemSet(SfxItemPool 
pPool) = 0;
 
 // internal access to SdrObject
-SdrObject GetSdrObject() const
-{
-return mrObject;
-}
+const SdrObject GetSdrObject() const;
+
+SdrObject GetSdrObject();
 
 // Test changeability for a single item. If a implementation wants 
to prevent
 // changing an item this method may be overloaded.
diff --git a/svx/source/sdr/properties/properties.cxx 
b/svx/source/sdr/properties/properties.cxx
index 5865948..e705fd4 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -44,6 +44,16 @@ namespace sdr
 {
 }
 
+const SdrObject BaseProperties::GetSdrObject() const
+{
+return mrObject;
+}
+
+SdrObject BaseProperties::GetSdrObject()
+{
+return mrObject;
+}
+
 const SfxItemSet BaseProperties::GetMergedItemSet() const
 {
 // default implementation falls back to GetObjectItemSet()
commit d425dce58875bfa3673c87dda09db8c7aa73a16d
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Fri Oct 24 14:41:45 2014 -0400

Scope reduction by early bailout.

Change-Id: I3a5c944d6ed863c347da03e0a60ff653232b3e72

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index c3d17a5..e14c892 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1643,112 +1643,109 @@ void SAL_CALL SvxShape::_setPropertyValue( const 
OUString rPropertyName, const
 
 const SfxItemPropertySimpleEntry* pMap = 
mpPropSet-getPropertyMapEntry(rPropertyName);
 
-if( mpObj.is()  mpModel )
+if (!mpObj.is() || !mpModel)
 {
-if( pMap == NULL )
-throw beans::UnknownPropertyException();
+// Since we have no actual sdr object right now, remember all
+// properties in a list. These properties will be set when the sdr
+// object is created.
 
-if( (pMap-nFlags  beans::PropertyAttribute::READONLY ) != 0 )
-throw beans::PropertyVetoException(
-( OUString(
-Readonly property can't be set:  )
-  + rPropertyName ),
-uno::Reference drawing::XShape ( this ) );
+if (pMap  pMap-nWID)
+{
+// FIXME: We should throw a UnknownPropertyException here.
+//But since this class is aggregated from classes that
+//support additional properties that we don't know here we
+//silently store *all* properties, even if they may be not
+//supported after creation.
+mpPropSet-setPropertyValue( pMap, rVal );
+}
+return;
+}
 
-mpModel-SetChanged();
+if (!pMap)
+throw beans::UnknownPropertyException();
 
-if(!setPropertyValueImpl( rPropertyName, pMap, rVal ) )
-{
-DBG_ASSERT( pMap-nWID == SDRATTR_TEXTDIRECTION || pMap-nWID  
SDRATTR_NOTPERSIST_FIRST || pMap-nWID  SDRATTR_NOTPERSIST_LAST, Not persist 
item not handled! );
-DBG_ASSERT( pMap-nWID  OWN_ATTR_VALUE_START || pMap-nWID  
OWN_ATTR_VALUE_END, Not item property not handled! );
+if ((pMap-nFlags  beans::PropertyAttribute::READONLY) != 0)
+throw beans::PropertyVetoException(
+OUString(Readonly property can't be set: ) + rPropertyName,
+uno::Referencedrawing::XShape(this));
 
-bool bIsNotPersist = pMap-nWID = SDRATTR_NOTPERSIST_FIRST  
pMap-nWID = SDRATTR_NOTPERSIST_LAST  pMap-nWID != SDRATTR_TEXTDIRECTION;
+mpModel-SetChanged();
 
-if( pMap-nWID == SDRATTR_ECKENRADIUS