summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-06-07 10:13:44 +0200
committerJoachim Lingner <jl@openoffice.org>2010-06-07 10:13:44 +0200
commit37a8224e7a1eb9084623f023a0830c9818e3d311 (patch)
tree2a727f2aef718d2d06ae20f7f228065da422f8a5 /svx/source
parentd0202ebd4e1be56cf1230a93a6d11cfc57050a5e (diff)
parent44ada130c3857b167e954b63c7a5490268b72c5b (diff)
jl152 merge with DEV300_m80
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/srchdlg.cxx14
-rw-r--r--svx/source/form/datanavi.cxx7
-rw-r--r--svx/source/form/fmundo.cxx47
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx22
-rw-r--r--svx/source/svdraw/svdoashp.cxx5
-rw-r--r--svx/source/unodraw/unoshape.cxx90
6 files changed, 152 insertions, 33 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index b39f59010e..5a2824c24d 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -831,6 +831,18 @@ void SvxSearchDialog::CalculateDelta_Impl()
pMoreBtn->AddWindow( &aNoFormatBtn );
}
+ if (bDrawApp || bImpressApp)
+ {
+ // "Find All" button is hidden--align "Find" vertically to the
+ // search listbox
+ Point aNewPt(aSearchBtn.GetPosPixel());
+ const Size aBtnSz(aSearchBtn.GetSizePixel());
+ const Size aLBSz(aSearchLB.GetSizePixel());
+ const int nOff((aLBSz.Height() - aBtnSz.Height()) / 2);
+ aNewPt.Y() = aSearchLB.GetPosPixel().Y() + nOff;
+ aSearchBtn.SetPosPixel(aNewPt);
+ }
+
if ( bDrawApp )
{
// Draw App: "Regular expressions" and "Search for Styles" check boxes are hidden
@@ -1016,6 +1028,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern )
if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_DRAW )
{
+ aSearchAllBtn.Hide();
+
aRegExpBtn.Hide();
aLayoutBtn.Hide();
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 6070adb015..af3cd66afc 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -3683,11 +3683,8 @@ namespace svxform
m_aURLED.DisableHistory();
m_aFilePickerBtn.SetClickHdl( LINK( this, AddInstanceDialog, FilePickerHdl ) );
- // load the filter name from svtools resource
- ByteString aResMgrName( "svt" );
- ResMgr* pSvtResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() );
- m_sAllFilterName = String( ResId( STR_FILTERNAME_ALL, *pSvtResMgr ) );
+ // load the filter name from fps_office resource
+ m_sAllFilterName = String( ResId( STR_FILTERNAME_ALL, *CREATEVERSIONRESMGR(fps_office) ) );
}
AddInstanceDialog::~AddInstanceDialog()
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 3900c5b694..c674648e08 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -90,25 +90,7 @@ class ScriptEventListenerWrapper : public ScriptEventListener_BASE
public:
ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel)
{
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference< XComponentContext > xCtx( xProps->getPropertyValue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
- if ( xCtx.is() )
- {
- Reference< XMultiComponentFactory > xMFac(
- xCtx->getServiceManager(), UNO_QUERY );
- if ( xMFac.is() )
- {
- m_vbaListener.set( xMFac->createInstanceWithContext(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ooo.vba.EventListener" ) ), xCtx ),
- UNO_QUERY_THROW );
- }
- }
- }
+
}
// XEventListener
virtual void SAL_CALL disposing(const EventObject& ) throw( RuntimeException ){}
@@ -136,6 +118,33 @@ public:
private:
void setModel()
{
+ if ( !m_vbaListener.is() )
+ {
+ Reference < XPropertySet > xProps(
+ ::comphelper::getProcessServiceFactory(), UNO_QUERY );
+ if ( xProps.is() )
+ {
+ Reference< XComponentContext > xCtx( xProps->getPropertyValue(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
+ if ( xCtx.is() )
+ {
+ Reference< XMultiComponentFactory > xMFac(
+ xCtx->getServiceManager(), UNO_QUERY );
+ SfxObjectShellRef xObjSh = pModel->GetObjectShell();
+ Reference< XMultiServiceFactory > xDocFac;
+ if ( xObjSh.Is() )
+ xDocFac.set( xObjSh->GetModel(), UNO_QUERY );
+
+ if ( xMFac.is() )
+ {
+ m_vbaListener.set( xMFac->createInstanceWithContext(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "ooo.vba.EventListener" ) ), xCtx ),
+ UNO_QUERY_THROW );
+ }
+ }
+ }
+ }
Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY );
if ( xProps.is() )
{
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 8c97ea69bd..1661c4d562 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -259,6 +259,8 @@ namespace sdr
void AttributeProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel)
{
+ OSL_ASSERT(pNewModel!=NULL);
+
if(pSrcPool && pDestPool && (pSrcPool != pDestPool))
{
if(mpItemSet)
@@ -291,8 +293,24 @@ namespace sdr
}
else
{
- // StyleSheet is NOT from the correct pool; use default
- ImpAddStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True);
+ // StyleSheet is NOT from the correct pool.
+ // Look one up in the right pool with the same
+ // name or use the default.
+
+ // Look up the style in the new document.
+ OSL_ASSERT(pNewModel->GetStyleSheetPool() != NULL);
+ SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>(
+ pNewModel->GetStyleSheetPool()->Find(
+ pStySheet->GetName(),
+ SFX_STYLE_FAMILY_ALL));
+ if (pNewStyleSheet == NULL
+ || &pNewStyleSheet->GetPool().GetPool() != pDestPool)
+ {
+ // There is no copy of the style in the new
+ // document. Use the default as a fallback.
+ pNewStyleSheet = pNewModel->GetDefaultStyleSheet();
+ }
+ ImpAddStyleSheet(pNewStyleSheet, sal_True);
}
}
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 03a7d30e92..6beb3dba74 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -700,7 +700,10 @@ void SdrObjCustomShape::MergeDefaultAttributes( const rtl::OUString* pType )
for ( i = 0; i < nCount; i++ )
{
if ( seqAdjustmentValues[ i ].State != com::sun::star::beans::PropertyState_DIRECT_VALUE )
+ {
seqAdjustmentValues[ i ].Value <<= pDefData[ i ];
+ seqAdjustmentValues[ i ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
+ }
}
}
aPropVal.Name = sAdjustmentValues;
@@ -2075,7 +2078,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
sal_Int32 nXDiff = aBoundRect.Left() - aRect.Left();
sal_Int32 nYDiff = aBoundRect.Top() - aRect.Top();
- if (nShearWink&&(bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX))
+ if (nShearWink&&((bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX)))
{
nShearWink = -nShearWink;
fTan = -fTan;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 396b3e45f4..a6a6ca22e8 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -358,7 +358,7 @@ const ::com::sun::star::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() t
}
//----------------------------------------------------------------------
-SvxShape* SvxShape::getImplementation( const uno::Reference< uno::XInterface >& xInt )
+SvxShape* SvxShape::getImplementation( const uno::Reference< uno::XInterface >& xInt )
{
uno::Reference< lang::XUnoTunnel > xUT( xInt, ::com::sun::star::uno::UNO_QUERY );
if( xUT.is() )
@@ -577,6 +577,37 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ if(mpModel)
+ {
+ SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fMMToTWIPS(72.0 / 127.0);
+
+ aTransform.scale(fMMToTWIPS, fMMToTWIPS);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to PoolMetric!");
+ }
+ }
+ }
+ }
+}
+// <--
+
+//----------------------------------------------------------------------
void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
@@ -604,6 +635,38 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
+ if(mpModel)
+ {
+ eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fTWIPSToMM(127.0 / 72.0);
+ aTransform.scale(fTWIPSToMM, fTWIPSToMM);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to 100th mm!");
+ }
+ }
+ }
+ }
+}
+// <--
+//----------------------------------------------------------------------
+
+
//----------------------------------------------------------------------
void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet,
SfxItemSet& rSet, uno::Reference< beans::XPropertySet > xSet, const SfxItemPropertyMap* pMap )
@@ -635,7 +698,6 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
{
if(rSet.GetPool()->IsWhich(pEntry->nWID))
rSet.Put(rSet.GetPool()->GetDefaultItem(pEntry->nWID));
-
// setzen
SvxItemPropertySet_setPropertyValue(rPropSet, pEntry, *pUsrAny, rSet);
}
@@ -650,7 +712,6 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet&
}
-
void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet)
{
DBG_TESTSOLARMUTEX();
@@ -2505,10 +2566,15 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if( rValue >>= aUnoPoint )
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ // perform metric change before applying anchor position,
+ // because the anchor position is in pool metric.
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
- ForceMetricToItemPoolMetric( aPoint );
pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
return true;
}
@@ -2532,6 +2598,9 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if ( rValue >>= aPolyPoly )
{
basegfx::B2DPolyPolygon aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ ForceMetricToItemPoolMetric( aNewPolyPolygon );
+ // <--
if( mpModel->IsWriter() )
{
Point aPoint( mpObj->GetAnchorPos() );
@@ -2554,6 +2623,9 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
@@ -2797,7 +2869,7 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
basegfx::B2DPolyPolygon aNewPolyPolygon;
basegfx::B2DHomMatrix aNewHomogenMatrix;
mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
-
+
aVclPoint.X() -= basegfx::fround(aNewHomogenMatrix.get(0, 2));
aVclPoint.Y() -= basegfx::fround(aNewHomogenMatrix.get(1, 2));
@@ -2970,6 +3042,9 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
Point aPoint( mpObj->GetAnchorPos() );
aPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aPoint.X(), -aPoint.Y()));
}
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
+ ForceMetricTo100th_mm( aPolyPoly );
+ // <--
drawing::PolyPolygonBezierCoords aRetval;
SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPoly, aRetval);
rValue <<= aRetval;
@@ -2990,6 +3065,9 @@ bool SvxShape::getPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
if( mpModel->IsWriter() )
aPoint -= mpObj->GetAnchorPos();
+ // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue 59051
+ ForceMetricTo100th_mm( aPoint );
+ // <--
awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
rValue <<= aUnoPoint;