summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorIngrid Halama [iha] <Ingrid.Halama@oracle.com>2011-02-03 12:49:56 +0100
committerIngrid Halama [iha] <Ingrid.Halama@oracle.com>2011-02-03 12:49:56 +0100
commit293b43ae4de478c550c8461de164f7cb8883daab (patch)
tree2571846610af8731f7b28c78eefdb55449aceed0 /svx
parent9073d77706b0b8c32f63a5ebd2954e1d4c0a3ce9 (diff)
parenta1a2a5a68046e75aba3dfd6ba06083a314f12182 (diff)
chart52: merge with DEV300_m99
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdmodel.hxx1
-rw-r--r--svx/source/fmcomp/fmgridif.cxx37
-rw-r--r--svx/source/fmcomp/gridcell.cxx10
-rw-r--r--svx/source/form/fmscriptingenv.cxx83
-rw-r--r--svx/source/form/fmview.cxx1
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/inc/typeconversionclient.hxx9
-rwxr-xr-x[-rw-r--r--]svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx12
-rw-r--r--svx/source/svdraw/svdmodel.cxx5
-rw-r--r--svx/source/unodraw/unopage.cxx14
-rw-r--r--svx/source/unodraw/unoshape.cxx9
11 files changed, 81 insertions, 102 deletions
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index b1bb7d74887f..21e9b5c5a05f 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -632,6 +632,7 @@ public:
/** application can set it's own undo manager, BegUndo, EndUndo and AddUndoAction
calls are routet to this interface if given */
void SetSdrUndoManager( SfxUndoManager* pUndoManager );
+ SfxUndoManager* GetSdrUndoManager() const;
/** applications can set their own undo factory to overide creation of
undo actions. The SdrModel will become owner of the given SdrUndoFactory
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index d6a530db85e3..783e07c3a2ed 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1974,10 +1974,12 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) )
{
- INetURLObject aHID( ::comphelper::getString(Value) );
- DBG_ASSERT( aHID.GetProtocol() == INET_PROT_HID, "Wrong HelpURL!" );
+ ::rtl::OUString sHelpURL;
+ OSL_VERIFY( Value >>= sHelpURL );
+ INetURLObject aHID( sHelpURL );
if ( aHID.GetProtocol() == INET_PROT_HID )
- pGrid->SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
+ sHelpURL = aHID.GetURLPath();
+ pGrid->SetHelpId( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) )
{
@@ -2073,25 +2075,28 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V
}
else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue());
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableNavigationBar( bValue );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- pGrid->EnableHandle(*(sal_Bool*)Value.getValue());
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableHandle( bValue );
}
else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) )
{
- if (Value.getValueType() == ::getBooleanCppuType())
- {
- // Im DesignModus nur das Datenfenster disablen
- // Sonst kann das Control nicht mehr konfiguriert werden
- if (isDesignMode())
- pGrid->GetDataWindow().Enable(*(sal_Bool*)Value.getValue());
- else
- pGrid->Enable(*(sal_Bool*)Value.getValue());
- }
+ sal_Bool bValue( sal_True );
+ OSL_VERIFY( Value >>= bValue );
+ pGrid->EnableHandle( bValue );
+
+ // Im DesignModus nur das Datenfenster disablen
+ // Sonst kann das Control nicht mehr konfiguriert werden
+ if (isDesignMode())
+ pGrid->GetDataWindow().Enable( bValue );
+ else
+ pGrid->Enable( bValue );
}
else
VCLXWindow::setProperty( PropertyName, Value );
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 7cdf707eb811..33a7dde794b4 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1193,7 +1193,7 @@ String DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Re
if ( _rxField.is() )
try
{
- aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType);
+ aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType);
}
catch( const Exception& )
{
@@ -1534,7 +1534,7 @@ String DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb::X
// ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst
// also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann
// ich den Rest (die Formatierung) dem FormattedField ueberlassen.
- double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType);
+ double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
return aText;
((FormattedField*)m_pPainter)->SetValue(dValue);
@@ -1578,7 +1578,7 @@ void DbFormattedField::UpdateFromField(const Reference< ::com::sun::star::sdb::X
// ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst
// also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann
// ich den Rest (die Formatierung) dem FormattedField ueberlassen.
- double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType);
+ double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
m_pWindow->SetText(String());
else
@@ -2556,7 +2556,7 @@ String DbComboBox::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn
if (_rxField.is())
try
{
- aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType );
+ aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType );
}
catch( const Exception& )
{
@@ -3167,7 +3167,7 @@ void DbFilterField::Update()
while (!xListCursor->isAfterLast() && i++ < SHRT_MAX) // max anzahl eintraege
{
- aStr = getValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
+ aStr = getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType);
aStringList.push_back(aStr);
xListCursor->next();
}
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index b8b4055ef5de..3e8aa88a2612 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include "fmscriptingenv.hxx"
-#include <svx/fmmodel.hxx>
+#include "svx/fmmodel.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -37,6 +37,7 @@
#include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
/** === end UNO includes === **/
+
#include <tools/diagnose_ex.h>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/implementationreference.hxx>
@@ -45,6 +46,8 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/app.hxx>
+#include <basic/basmgr.hxx>
#include <boost/shared_ptr.hpp>
@@ -416,60 +419,6 @@ namespace svxform
m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs );
}
-
- //................................................................
- //. QualifiedBasicScript
- //................................................................
- class QualifiedBasicScript : public IScript
- {
- SfxObjectShell& m_rObjectShell;
- const ::rtl::OUString m_sMacroLocation;
- const ::rtl::OUString m_sScriptCode;
-
- public:
- QualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rLocation, const ::rtl::OUString& _rScriptCode )
- :m_rObjectShell( _rObjectShell )
- ,m_sMacroLocation( _rLocation )
- ,m_sScriptCode( _rScriptCode )
- {
- }
-
- // IScript
- virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult );
- };
-
- //................................................................
- void QualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
- {
- m_rObjectShell.CallStarBasicScript( m_sScriptCode, m_sMacroLocation,
- &_rArguments, &_rSynchronousResult );
- }
-
- //................................................................
- //. UnqualifiedBasicScript
- //................................................................
- class UnqualifiedBasicScript : public IScript
- {
- SfxObjectShell& m_rObjectShell;
- const ::rtl::OUString m_sScriptCode;
-
- public:
- UnqualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rScriptCode )
- :m_rObjectShell( _rObjectShell )
- ,m_sScriptCode( _rScriptCode )
- {
- }
-
- // IScript
- virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult );
- };
-
- //................................................................
- void UnqualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
- {
- m_rObjectShell.CallScript( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" ) ), m_sScriptCode,
- &_rArguments, &_rSynchronousResult );
- }
}
//--------------------------------------------------------------------
@@ -514,14 +463,24 @@ namespace svxform
sScriptCode = sScriptCode.copy( nPrefixLen + 1 );
}
- if ( sMacroLocation.getLength() )
- { // we have a StarBasic macro with fully-qualified macro location
- pScript.reset( new QualifiedBasicScript( *xObjectShell, sMacroLocation, sScriptCode ) );
- }
- else
- { // we have a StarBasic macro without qualified location - let the object shell gues ....
- pScript.reset( new UnqualifiedBasicScript( *xObjectShell, sScriptCode ) );
+ if ( !sMacroLocation.getLength() )
+ {
+ // legacy format: use the app-wide Basic, if it has a respective method, otherwise fall back to the doc's Basic
+ if ( SFX_APP()->GetBasicManager()->HasMacro( sScriptCode ) )
+ sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application" ) );
+ else
+ sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "document" ) );
}
+
+ ::rtl::OUStringBuffer aScriptURI;
+ aScriptURI.appendAscii( "vnd.sun.star.script:" );
+ aScriptURI.append( sScriptCode );
+ aScriptURI.appendAscii( "?language=Basic" );
+ aScriptURI.appendAscii( "&location=" );
+ aScriptURI.append( sMacroLocation );
+
+ const ::rtl::OUString sScriptURI( aScriptURI.makeStringAndClear() );
+ pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) );
}
OSL_ENSURE( pScript.get(), "FormScriptingEnvironment::doFireScriptEvent: no script to execute!" );
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index f9980284993d..1147e71b0731 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -46,7 +46,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <basic/sbuno.hxx>
-#include <sfx2/macrconf.hxx>
#include <basic/sbx.hxx>
#include "fmitems.hxx"
#include "fmobj.hxx"
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 7087e3d6793f..528661d2abe4 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -81,7 +81,7 @@
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/uno3.hxx>
-#include <comphelper/scopeguard.hxx>
+#include <comphelper/flagguard.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <toolkit/controls/unocontrol.hxx>
diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx
index 53bf13b7702c..9ff7e12fe4d0 100644
--- a/svx/source/inc/typeconversionclient.hxx
+++ b/svx/source/inc/typeconversionclient.hxx
@@ -60,17 +60,16 @@ namespace svxform
// --------------------------------------------------------
inline double getValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
- const ::com::sun::star::util::Date& _rNullDate,
- sal_Int16 _nKeyType) const
+ const ::com::sun::star::util::Date& _rNullDate ) const
{
double nReturn(0);
if ( ensureLoaded() )
- nReturn = m_xTypeConversion->getValue(_rxVariant, _rNullDate, _nKeyType);
+ nReturn = m_xTypeConversion->getValue( _rxVariant, _rNullDate );
return nReturn;
}
// --------------------------------------------------------
- inline ::rtl::OUString getValue(
+ inline ::rtl::OUString getFormattedValue(
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
const ::com::sun::star::util::Date& _rNullDate,
@@ -79,7 +78,7 @@ namespace svxform
{
::rtl::OUString sReturn;
if ( ensureLoaded() )
- sReturn = m_xTypeConversion->getValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
+ sReturn = m_xTypeConversion->getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
return sReturn;
}
};
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 3f849e92b462..5e225e626175 100644..100755
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -367,6 +367,10 @@ namespace sdr { namespace contact {
::basegfx::B2DTuple aViewScale, aViewTranslate;
double nViewRotate(0), nViewShearX(0);
_rViewTransformation.decompose( aViewScale, aViewTranslate, nViewRotate, nViewShearX );
+
+ ::basegfx::B2DTuple aZoomScale, aZoomTranslate;
+ double nZoomRotate(0), nZoomShearX(0);
+ _rZoomLevelNormalization.decompose( aZoomScale, aZoomTranslate, nZoomRotate, nZoomShearX );
#endif
// transform the logic bound rect, using the view transformation, to pixel coordinates
@@ -979,6 +983,10 @@ namespace sdr { namespace contact {
aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() );
aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() );
m_aZoomLevelNormalization *= aScaleNormalization;
+
+ #if OSL_DEBUG_LEVEL > 1
+ m_aZoomLevelNormalization.decompose( aScale, aTranslate, fRotate, fShearX );
+ #endif
}
//--------------------------------------------------------------------
@@ -1818,6 +1826,10 @@ namespace sdr { namespace contact {
// disposed the control though it doesn't own it. So, /me thinks we should not bother here.
return drawinglayer::primitive2d::Primitive2DSequence();
+ if ( GetObjectContact().getViewInformation2D().getViewTransformation().isIdentity() )
+ // remove this when #i115754# is fixed
+ return drawinglayer::primitive2d::Primitive2DSequence();
+
// ignore existing controls which are in alive mode and manually switched to "invisible"
// #102090# / 2009-06-05 / frank.schoenheit@sun.com
const ControlHolder& rControl( m_pImpl->getExistentControl() );
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 7718451ab945..80b586c01600 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -2115,6 +2115,11 @@ void SdrModel::SetSdrUndoManager( SfxUndoManager* pUndoManager )
mpImpl->mpUndoManager = pUndoManager;
}
+SfxUndoManager* SdrModel::GetSdrUndoManager() const
+{
+ return mpImpl->mpUndoManager;
+}
+
SdrUndoFactory& SdrModel::GetSdrUndoFactory() const
{
if( !mpImpl->mpUndoFactory )
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index a905aa0fd2f4..af6a35ddd5ef 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -58,6 +58,7 @@
#include <svx/extrud3d.hxx>
#include <svx/lathe3d.hxx>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
using ::rtl::OUString;
using namespace ::vos;
@@ -306,7 +307,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
{
OGuard aGuard( Application::GetSolarMutex() );
- if( (mpModel == 0) || (mpPage == 0) )
+ if ( ( mpModel == NULL ) || ( mpPage == NULL ) )
throw lang::DisposedException();
SvxShape* pShape = SvxShape::getImplementation( xShape );
@@ -319,6 +320,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
if(!pObj)
{
pObj = CreateSdrObject( xShape );
+ ENSURE_OR_RETURN_VOID( pObj != NULL, "SvxDrawPage::add: no SdrObject was created!" );
}
else if ( !pObj->IsInserted() )
{
@@ -326,14 +328,10 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
mpPage->InsertObject( pObj );
}
- if(pObj == NULL)
- return;
-
- if(pShape)
- pShape->Create( pObj, this );
+ pShape->Create( pObj, this );
+ OSL_ENSURE( pShape->GetSdrObject() == pObj, "SvxDrawPage::add: shape does not know about its newly created SdrObject!" );
- if( mpModel )
- mpModel->SetChanged();
+ mpModel->SetChanged();
}
//----------------------------------------------------------------------
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0f1482adaf5d..839c4553a859 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -147,7 +147,7 @@ struct SvxShapeImpl
* SdrObject so a multiple call to SvxShape::Create() with same SdrObject
* is prohibited.
*/
- SdrObject* mpCreatedObj;
+ ::tools::WeakReference< SdrObject > mpCreatedObj;
// for xComponent
::cppu::OInterfaceContainerHelper maDisposeListeners;
@@ -160,7 +160,7 @@ struct SvxShapeImpl
,mpMaster( NULL )
,mbHasSdrObjectOwnership( false )
,mbDisposing( false )
- ,mpCreatedObj( NULL )
+ ,mpCreatedObj()
,maDisposeListeners( _rMutex )
,maPropertyNotifier( _rAntiImpl, _rMutex )
{
@@ -468,11 +468,12 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ )
if ( !pNewObj )
return;
- OSL_ENSURE( ( mpImpl->mpCreatedObj == NULL ) || ( mpImpl->mpCreatedObj == pNewObj ),
+ SdrObject* pCreatedObj = mpImpl->mpCreatedObj.get();
+ OSL_ENSURE( ( pCreatedObj == NULL ) || ( pCreatedObj == pNewObj ),
"SvxShape::Create: the same shape used for two different objects?! Strange ..." );
// --> CL, OD 2005-07-19 #i52126# - correct condition
- if ( mpImpl->mpCreatedObj != pNewObj )
+ if ( pCreatedObj != pNewObj )
// <--
{
DBG_ASSERT( pNewObj->GetModel(), "no model for SdrObject?" );