summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/inc/svx/gridctrl.hxx14
-rw-r--r--svx/inc/svx/svdobj.hxx17
-rw-r--r--svx/inc/svx/svdouno.hxx2
-rw-r--r--svx/inc/svx/unoshape.hxx5
-rw-r--r--svx/source/fmcomp/gridcell.cxx29
-rw-r--r--svx/source/fmcomp/gridctrl.cxx92
-rw-r--r--svx/source/form/fmprop.cxx2
-rw-r--r--svx/source/form/fmvwimp.cxx6
-rw-r--r--svx/source/inc/fmprop.hrc1
-rw-r--r--svx/source/inc/gridcell.hxx9
-rw-r--r--svx/source/svdraw/svdobj.cxx5
-rw-r--r--svx/source/svdraw/svdouno.cxx22
-rw-r--r--svx/source/unodraw/unoprov.cxx1
-rw-r--r--svx/source/unodraw/unoshap2.cxx133
-rw-r--r--xmloff/source/draw/sdpropls.cxx3
-rw-r--r--xmloff/source/draw/shapeexport.cxx2
-rw-r--r--xmloff/source/forms/propertyexport.cxx2
-rw-r--r--xmloff/source/style/xmlexppr.cxx45
18 files changed, 247 insertions, 143 deletions
diff --git a/svx/inc/svx/gridctrl.hxx b/svx/inc/svx/gridctrl.hxx
index 5b7637cce621..632ca6ea0805 100644
--- a/svx/inc/svx/gridctrl.hxx
+++ b/svx/inc/svx/gridctrl.hxx
@@ -122,6 +122,18 @@ public:
#define GRID_COLUMN_NOT_FOUND ((sal_uInt16)-1)
//==================================================================
+// InitWindowFacet, describing which aspect of a column's Window to (re-)initialize
+//==================================================================
+enum InitWindowFacet
+{
+ InitFont = 0x01,
+ InitForeground = 0x02,
+ InitBackground = 0x04,
+ InitWritingMode = 0x08,
+ InitAll = 0xFF
+};
+
+//==================================================================
class FmXGridSourcePropListener;
class DisposeListenerGridBridge;
typedef ::svt::EditBrowseBox DbGridControl_Base;
@@ -585,7 +597,7 @@ protected:
protected:
virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol);
void Construct();
- void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ void ImplInitWindow( const InitWindowFacet _eInitWhat );
DECL_LINK(OnDelete, void*);
DECL_LINK(OnAsyncAdjust, void*);
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 3d1b28bf1b9d..65ab5a8d4ebd 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -943,6 +943,23 @@ public:
virtual void DisconnectFromNode(FASTBOOL bTail1);
virtual SdrObject* GetConnectedNode(FASTBOOL bTail1) const;
+ /** sets the writing mode of the object's context
+
+ Objects which itself do not support different writing modes will ignore this call.
+
+ Objects which support different writing modes, but have an own, explicit writing mode set,
+ will also ignore this call.
+
+ Objects which support different writing modes, and whose own mode is set to css.text.WritingMode2.CONTEXT,
+ will use the given writing mode to calculate their "effective writing mode".
+
+ The behaviour of this method is undefined if you pass css.text.WritingMode2.CONTEXT.
+
+ @param _nContextWritingMode
+ the effective writing mode of the context of the object
+ */
+ virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode );
+
// Wenn ein Objekt in der Lage ist, sich in ein Polygon oder in eine
// Bezierkurve (oder beides) zu verwandeln, dann sollten die folgenden
// Methoden ueberladen werden.
diff --git a/svx/inc/svx/svdouno.hxx b/svx/inc/svx/svdouno.hxx
index c1914f0b59ee..b454c59207f8 100644
--- a/svx/inc/svx/svdouno.hxx
+++ b/svx/inc/svx/svdouno.hxx
@@ -101,6 +101,8 @@ public:
virtual void TakeObjNameSingul(XubString& rName) const;
virtual void TakeObjNamePlural(XubString& rName) const;
+ virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode );
+
::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > GetUnoControlModel() const {return xUnoControlModel;}
::com::sun::star::uno::Reference< com::sun::star::awt::XControl > GetUnoControl(const SdrView& _rView, const OutputDevice& _rOut) const;
diff --git a/svx/inc/svx/unoshape.hxx b/svx/inc/svx/unoshape.hxx
index 61d691984079..3d55f9286236 100644
--- a/svx/inc/svx/unoshape.hxx
+++ b/svx/inc/svx/unoshape.hxx
@@ -483,11 +483,6 @@ public:
***********************************************************************/
class SVX_DLLPUBLIC SvxShapeControl : public ::com::sun::star::drawing::XControlShape, public SvxShapeText
{
-private:
- void convertPropertyName( const rtl::OUString& rApiName, rtl::OUString& rInternalName );
- void valueAlignToParaAdjust(::com::sun::star::uno::Any& rValue); //added by BerryJia for fixing Bug102407 2002-11-04
- void valueParaAdjustToAlign(::com::sun::star::uno::Any& rValue); //added by BerryJia for fixing Bug102407 2002-11-04
-
protected:
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 72aeb08ce60a..49778b7a4b69 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -525,10 +525,10 @@ void DbGridColumn::Paint(OutputDevice& rDev,
}
//------------------------------------------------------------------------------
-void DbGridColumn::ImplInitSettings(Window& rParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground)
+void DbGridColumn::ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat )
{
- if (m_pCell)
- m_pCell->ImplInitSettings(rParent, bFont, bForeground, bBackground);
+ if ( m_pCell )
+ m_pCell->ImplInitWindow( rParent, _eInitWhat );
}
//==============================================================================
@@ -685,10 +685,20 @@ sal_Bool DbCellControl::Commit()
}
//------------------------------------------------------------------------------
-void DbCellControl::ImplInitSettings(Window& rParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground)
+void DbCellControl::ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat )
{
Window* pWindows[] = { m_pPainter, m_pWindow };
- if (bFont)
+
+ if ( ( _eInitWhat & InitWritingMode ) != 0 )
+ {
+ for ( size_t i=0; i < sizeof( pWindows ) / sizeof( pWindows[0] ); ++i )
+ {
+ if ( pWindows[i] )
+ pWindows[i]->EnableRTL( rParent.IsRTLEnabled() );
+ }
+ }
+
+ if ( ( _eInitWhat & InitFont ) != 0 )
{
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
{
@@ -713,7 +723,9 @@ void DbCellControl::ImplInitSettings(Window& rParent, sal_Bool bFont, sal_Bool b
}
}
- if (bFont || bForeground)
+ if ( ( ( _eInitWhat & InitFont ) != 0 )
+ || ( ( _eInitWhat & InitForeground ) != 0 )
+ )
{
Color aTextColor( rParent.IsControlForeground() ? rParent.GetControlForeground() : rParent.GetTextColor() );
@@ -736,7 +748,7 @@ void DbCellControl::ImplInitSettings(Window& rParent, sal_Bool bFont, sal_Bool b
}
}
- if (bBackground)
+ if ( ( _eInitWhat & InitBackground ) != 0 )
{
if (rParent.IsControlBackground())
{
@@ -811,7 +823,8 @@ void DbCellControl::implAdjustEnabled( const Reference< XPropertySet >& _rxModel
//------------------------------------------------------------------------------
void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor )
{
- ImplInitSettings( rParent, sal_True, sal_True, sal_True );
+ ImplInitWindow( rParent, InitAll );
+
if ( m_pWindow )
{
// align the control
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 4b997db3b08e..b3b18632884c 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -754,32 +754,44 @@ void DbGridControl::NavigationBar::Paint(const Rectangle& rRect)
//------------------------------------------------------------------------------
void DbGridControl::NavigationBar::StateChanged( StateChangedType nType )
{
- Control::StateChanged(nType);
- if (STATE_CHANGE_ZOOM == nType)
- {
- Fraction aZoom = GetZoom();
+ Control::StateChanged( nType );
- Window* pWindows[] = {
- &m_aRecordText,
- &m_aAbsolute,
- &m_aRecordOf,
- &m_aRecordCount,
- &m_aFirstBtn,
- &m_aPrevBtn,
- &m_aNextBtn,
- &m_aLastBtn,
- &m_aNewBtn
- };
+ Window* pWindows[] = { &m_aRecordText,
+ &m_aAbsolute,
+ &m_aRecordOf,
+ &m_aRecordCount,
+ &m_aFirstBtn,
+ &m_aPrevBtn,
+ &m_aNextBtn,
+ &m_aLastBtn,
+ &m_aNewBtn
+ };
- // not all of these controls need to know the new zoom, but to be sure ...
- Font aFont( IsControlFont() ? GetControlFont() : GetPointFont());
- for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
+ switch ( nType )
+ {
+ case STATE_CHANGE_MIRRORING:
{
- pWindows[i]->SetZoom(aZoom);
- pWindows[i]->SetZoomedPointFont(aFont);
+ BOOL bIsRTLEnabled = IsRTLEnabled();
+ for ( size_t i=0; i < sizeof( pWindows ) / sizeof( pWindows[0] ); ++i )
+ pWindows[i]->EnableRTL( bIsRTLEnabled );
}
- // rearrange the controls
- m_nDefaultWidth = ArrangeControls();
+ break;
+
+ case STATE_CHANGE_ZOOM:
+ {
+ Fraction aZoom = GetZoom();
+
+ // not all of these controls need to know the new zoom, but to be sure ...
+ Font aFont( IsControlFont() ? GetControlFont() : GetPointFont());
+ for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
+ {
+ pWindows[i]->SetZoom(aZoom);
+ pWindows[i]->SetZoomedPointFont(aFont);
+ }
+ // rearrange the controls
+ m_nDefaultWidth = ArrangeControls();
+ }
+ break;
}
}
@@ -935,7 +947,7 @@ DbGridControl::DbGridControl(
String sName(SVX_RES(RID_STR_NAVIGATIONBAR));
m_aBar.SetAccessibleName(sName);
m_aBar.Show();
- ImplInitSettings(sal_True,sal_True,sal_True);
+ ImplInitWindow( InitAll );
}
//------------------------------------------------------------------------------
@@ -1002,11 +1014,17 @@ DbGridControl::~DbGridControl()
void DbGridControl::StateChanged( StateChangedType nType )
{
DbGridControl_Base::StateChanged( nType );
+
switch (nType)
{
+ case STATE_CHANGE_MIRRORING:
+ ImplInitWindow( InitWritingMode );
+ Invalidate();
+ break;
+
case STATE_CHANGE_ZOOM:
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitWindow( InitFont );
// and give it a chance to rearrange
Point aPoint = GetControlArea().TopLeft();
@@ -1016,15 +1034,15 @@ void DbGridControl::StateChanged( StateChangedType nType )
}
break;
case STATE_CHANGE_CONTROLFONT:
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitWindow( InitFont );
Invalidate();
break;
case STATE_CHANGE_CONTROLFOREGROUND:
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitWindow( InitForeground );
Invalidate();
break;
case STATE_CHANGE_CONTROLBACKGROUND:
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitWindow( InitBackground );
Invalidate();
break;
}
@@ -1037,7 +1055,7 @@ void DbGridControl::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitWindow( InitAll );
Invalidate();
}
}
@@ -1055,16 +1073,24 @@ void DbGridControl::Select()
}
//------------------------------------------------------------------------------
-void DbGridControl::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
+void DbGridControl::ImplInitWindow( const InitWindowFacet _eInitWhat )
{
- for (sal_uInt32 i = 0; i < m_aColumns.Count(); i++)
+ for ( sal_uInt32 i = 0; i < m_aColumns.Count(); ++i )
{
DbGridColumn* pCol = m_aColumns.GetObject(i);
if (pCol)
- pCol->ImplInitSettings( GetDataWindow(), bFont, bForeground, bBackground );
+ pCol->ImplInitWindow( GetDataWindow(), _eInitWhat );
+ }
+
+ if ( ( _eInitWhat & InitWritingMode ) != 0 )
+ {
+ if ( m_bNavigationBar )
+ {
+ m_aBar.EnableRTL( IsRTLEnabled() );
+ }
}
- if ( bFont )
+ if ( ( _eInitWhat & InitFont ) != 0 )
{
if ( m_bNavigationBar )
{
@@ -1083,7 +1109,7 @@ void DbGridControl::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_
}
}
- if (bBackground)
+ if ( ( _eInitWhat & InitBackground ) != 0 )
{
if (IsControlBackground())
{
diff --git a/svx/source/form/fmprop.cxx b/svx/source/form/fmprop.cxx
index 577b8b3ec550..2cf5f158ac1f 100644
--- a/svx/source/form/fmprop.cxx
+++ b/svx/source/form/fmprop.cxx
@@ -188,5 +188,7 @@ namespace svxform
IMPLEMENT_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS, "FormOperations" );
IMPLEMENT_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED, "InputRequired" );
+ IMPLEMENT_CONSTASCII_USTRING( FM_PROP_WRITING_MODE, "WritingMode" );
+
} // namespace svxform
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 4a8d993cf595..398e14d3a25b 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -84,6 +84,7 @@
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbc/XPreparedStatement.hpp>
#include <com/sun/star/sdb/XQueriesSupplier.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
/** === end UNO includes === **/
#include <comphelper/enumhelper.hxx>
@@ -119,6 +120,8 @@ using com::sun::star::style::VerticalAlignment_MIDDLE;
using ::com::sun::star::form::binding::XValueBinding;
using ::com::sun::star::form::binding::XBindableValue;
+namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
+
namespace svxform
{
//========================================================================
@@ -1052,6 +1055,9 @@ IMPL_LINK( FmXFormView, OnStartControlWizard, void*, /**/ )
DBG_UNHANDLED_EXCEPTION();
}
}
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( FM_PROP_WRITING_MODE ) )
+ _rxModel->setPropertyValue( FM_PROP_WRITING_MODE, makeAny( WritingMode2::CONTEXT ) );
}
m_xLastCreatedControlModel.clear();
diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc
index 8bf5da856f70..adfb73ad1dc8 100644
--- a/svx/source/inc/fmprop.hrc
+++ b/svx/source/inc/fmprop.hrc
@@ -181,6 +181,7 @@ namespace svxform
DECLARE_CONSTASCII_USTRING( FM_PROP_BUTTON_TYPE );
DECLARE_CONSTASCII_USTRING( FM_PROP_FORM_OPERATIONS );
DECLARE_CONSTASCII_USTRING( FM_PROP_INPUT_REQUIRED );
+ DECLARE_CONSTASCII_USTRING( FM_PROP_WRITING_MODE );
} // namespace svxform
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index f621eb04ea6f..6a552da6edb7 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -183,7 +183,8 @@ public:
void SetReadOnly(sal_Bool bRead){m_bReadOnly = bRead;}
void SetObject(sal_Int16 nPos) {m_bObject = m_bReadOnly = sal_True; m_nFieldPos = nPos;}
- void ImplInitSettings( Window& rParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+
+ void ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat );
// Properties, die auf den ::com::sun::star::frame::Controller durchschlagen koennen
sal_Int16 SetAlignment(sal_Int16 _nAlign);
@@ -308,7 +309,7 @@ public:
virtual void PaintFieldToCell( OutputDevice& rDev, const Rectangle& rRect, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter);
virtual void PaintCell( OutputDevice& _rDev, const Rectangle& _rRect );
- void ImplInitSettings( Window& rParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ void ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat );
double GetValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxField, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xFormatter) const;
@@ -781,8 +782,8 @@ public:
virtual void SAL_CALL setLock(sal_Bool _bLock) throw(::com::sun::star::uno::RuntimeException);
sal_Bool Commit() {return m_pCellControl->Commit();}
- void ImplInitSettings( Window& rParent, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
- { m_pCellControl->ImplInitSettings( rParent, bFont, bForeground, bBackground ); }
+ void ImplInitWindow( Window& rParent, const InitWindowFacet _eInitWhat )
+ { m_pCellControl->ImplInitWindow( rParent, _eInitWhat ); }
sal_Bool isAlignedController() const { return m_pCellControl->isAlignedController(); }
void AlignControl(sal_Int16 nAlignment)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 514d78e2cbf9..d9f7ffa0c922 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -3077,6 +3077,11 @@ void SdrObject::SetBLIPSizeRectangle( const Rectangle& aRect )
maBLIPSizeRectangle = aRect;
}
+void SdrObject::SetContextWritingMode( const sal_Int16 /*_nContextWritingMode*/ )
+{
+ // this base class does not support different writing modes, so ignore the call
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@ @@@@@@ @@@@ @@@@@ @@ @@
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 2c42adfd63c6..92077ebf85c2 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -61,8 +61,8 @@
#include <memory>
#include <svx/sdrpagewindow.hxx>
#include <sdrpaintwindow.hxx>
+#include <tools/diagnose_ex.h>
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::sdr::contact;
@@ -251,6 +251,22 @@ UINT16 SdrUnoObj::GetObjIdentifier() const
return UINT16(OBJ_UNO);
}
+void SdrUnoObj::SetContextWritingMode( const sal_Int16 _nContextWritingMode )
+{
+ try
+ {
+ uno::Reference< beans::XPropertySet > xModelProperties( GetUnoControlModel(), uno::UNO_QUERY_THROW );
+ xModelProperties->setPropertyValue(
+ ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "ContextWritingMode" ) ),
+ uno::makeAny( _nContextWritingMode )
+ );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
// ----------------------------------------------------------------------------
namespace
{
@@ -379,7 +395,7 @@ void SdrUnoObj::operator = (const SdrObject& rObj)
if (xSet.is())
{
uno::Any aValue( xSet->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl")) );
- OUString aStr;
+ ::rtl::OUString aStr;
if( aValue >>= aStr )
aUnoControlTypeName = String(aStr);
@@ -545,7 +561,7 @@ void SdrUnoObj::SetUnoControlModel( uno::Reference< awt::XControlModel > xModel)
if (xSet.is())
{
uno::Any aValue( xSet->getPropertyValue(String("DefaultControl", gsl_getSystemTextEncoding())) );
- OUString aStr;
+ ::rtl::OUString aStr;
if( aValue >>= aStr )
aUnoControlTypeName = String(aStr);
}
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index bbb05cb7d3ae..a897b486b5e3 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -634,6 +634,7 @@ SfxItemPropertyMap* ImplGetSvxControlShapePropertyMap()
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT, &::getBooleanCppuType(),0, 0},
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT, &::getBooleanCppuType(),0, 0},
{ MAP_CHAR_LEN("ControlTextEmphasis"), 0, &::getCppuType((const sal_Int16*)0), 0, 0 },
+ { MAP_CHAR_LEN("ControlWritingMode"), 0, &::cppu::UnoType< sal_Int16 >::get(), 0, 0},
// the following properties are handled by SvxShape
{ MAP_CHAR_LEN("Transformation"), OWN_ATTR_TRANSFORMATION , &::getCppuType((const struct com::sun::star::drawing::HomogenMatrix3*)0), 0, 0 },
{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_ZORDER), OWN_ATTR_ZORDER , &::getCppuType((const sal_Int32*)0), 0, 0},
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index ad90a29093b8..654318630069 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -715,75 +715,89 @@ SvxShapeControlPropertyMapping[] =
{ MAP_CHAR_LEN("ControlBorderColor"), MAP_CHAR_LEN("BorderColor") },
{ MAP_CHAR_LEN("ControlTextEmphasis"), MAP_CHAR_LEN("FontEmphasisMark") },
{ MAP_CHAR_LEN("ImageScaleMode"), MAP_CHAR_LEN("ScaleMode") },
+ { MAP_CHAR_LEN("ControlWritingMode"), MAP_CHAR_LEN("WritingMode") },
{ NULL,0, NULL, 0 }
};
-void SvxShapeControl::convertPropertyName( const OUString& rApiName, OUString& rInternalName )
+namespace
{
- sal_uInt16 i = 0;
- while( SvxShapeControlPropertyMapping[i].mpAPIName )
+ static bool lcl_convertPropertyName( const OUString& rApiName, OUString& rInternalName )
{
- if( rApiName.reverseCompareToAsciiL( SvxShapeControlPropertyMapping[i].mpAPIName, SvxShapeControlPropertyMapping[i].mnAPINameLen ) == 0 )
+ sal_uInt16 i = 0;
+ while( SvxShapeControlPropertyMapping[i].mpAPIName )
{
- rInternalName = OUString( SvxShapeControlPropertyMapping[i].mpFormName, SvxShapeControlPropertyMapping[i].mnFormNameLen, RTL_TEXTENCODING_ASCII_US );
+ if( rApiName.reverseCompareToAsciiL( SvxShapeControlPropertyMapping[i].mpAPIName, SvxShapeControlPropertyMapping[i].mnAPINameLen ) == 0 )
+ {
+ rInternalName = OUString( SvxShapeControlPropertyMapping[i].mpFormName, SvxShapeControlPropertyMapping[i].mnFormNameLen, RTL_TEXTENCODING_ASCII_US );
+ }
+ ++i;
}
- ++i;
+ return rInternalName.getLength() > 0;
}
-}
-//added by BerryJia for fixing Bug102407 2002-11-04
-static struct
-{
- sal_Int16 nAPIValue;
- sal_Int16 nFormValue;
-}
-SvxShapeControlPropertyValueMapping[] =
-{
- // note that order matters:
- // valueAlignToParaAdjust and valueParaAdjustToAlign search this map from the _beginning_
- // and use the first matching entry
- {style::ParagraphAdjust_LEFT, (sal_Int16)awt::TextAlign::LEFT},
- {style::ParagraphAdjust_CENTER, (sal_Int16)awt::TextAlign::CENTER},
- {style::ParagraphAdjust_RIGHT, (sal_Int16)awt::TextAlign::RIGHT},
- {style::ParagraphAdjust_BLOCK, (sal_Int16)awt::TextAlign::RIGHT},
- {style::ParagraphAdjust_STRETCH, (sal_Int16)awt::TextAlign::LEFT},
- {-1,-1}
-};
+ struct EnumConversionMap
+ {
+ sal_Int16 nAPIValue;
+ sal_Int16 nFormValue;
+ };
-void SvxShapeControl::valueAlignToParaAdjust(Any& rValue)
-{
- sal_Int16 nValue = sal_Int16();
- rValue >>= nValue;
- sal_uInt16 i = 0;
- while (-1 != SvxShapeControlPropertyValueMapping[i].nFormValue)
+ EnumConversionMap aMapAdjustToAlign[] =
+ {
+ // note that order matters:
+ // lcl_convertTextAlignmentToParaAdjustment and lcl_convertParaAdjustmentToTextAlignment search this map from the _beginning_
+ // and use the first matching entry
+ {style::ParagraphAdjust_LEFT, (sal_Int16)awt::TextAlign::LEFT},
+ {style::ParagraphAdjust_CENTER, (sal_Int16)awt::TextAlign::CENTER},
+ {style::ParagraphAdjust_RIGHT, (sal_Int16)awt::TextAlign::RIGHT},
+ {style::ParagraphAdjust_BLOCK, (sal_Int16)awt::TextAlign::RIGHT},
+ {style::ParagraphAdjust_STRETCH, (sal_Int16)awt::TextAlign::LEFT},
+ {-1,-1}
+ };
+
+ static void lcl_mapFormToAPIValue( Any& _rValue, const EnumConversionMap* _pMap )
{
- if (nValue == SvxShapeControlPropertyValueMapping[i].nFormValue)
+ sal_Int16 nValue = sal_Int16();
+ OSL_VERIFY( _rValue >>= nValue );
+
+ const EnumConversionMap* pEntry = _pMap;
+ while ( pEntry && ( pEntry->nFormValue != -1 ) )
{
- rValue <<= (SvxShapeControlPropertyValueMapping[i].nAPIValue);
- return;
+ if ( nValue == pEntry->nFormValue )
+ {
+ _rValue <<= pEntry->nAPIValue;
+ return;
+ }
+ ++pEntry;
}
- i++;
}
-}
-void SvxShapeControl::valueParaAdjustToAlign(Any& rValue)
-{
- sal_Int32 nValue = 0;
- rValue >>= nValue;
- sal_uInt16 i = 0;
- while (-1 != SvxShapeControlPropertyValueMapping[i].nAPIValue)
+ static void lcl_mapAPIToFormValue( Any& _rValue, const EnumConversionMap* _pMap )
{
- if ( nValue == SvxShapeControlPropertyValueMapping[i].nAPIValue)
+ sal_Int32 nValue = 0;
+ OSL_VERIFY( _rValue >>= nValue );
+
+ const EnumConversionMap* pEntry = _pMap;
+ while ( pEntry && ( pEntry->nAPIValue != -1 ) )
{
- rValue <<= (SvxShapeControlPropertyValueMapping[i].nFormValue);
- return;
+ if ( nValue == pEntry->nAPIValue )
+ {
+ _rValue <<= pEntry->nFormValue;
+ return;
+ }
+ ++pEntry;
}
- i++;
}
-}
-namespace
-{
+ static void lcl_convertTextAlignmentToParaAdjustment( Any& rValue )
+ {
+ lcl_mapFormToAPIValue( rValue, aMapAdjustToAlign );
+ }
+
+ static void lcl_convertParaAdjustmentToTextAlignment( Any& rValue )
+ {
+ lcl_mapAPIToFormValue( rValue, aMapAdjustToAlign );
+ }
+
void convertVerticalAdjustToVerticalAlign( Any& _rValue ) SAL_THROW( ( lang::IllegalArgumentException ) )
{
if ( !_rValue.hasValue() )
@@ -823,8 +837,7 @@ void SAL_CALL SvxShapeControl::setPropertyValue( const OUString& aPropertyName,
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException)
{
OUString aFormsName;
- convertPropertyName( aPropertyName, aFormsName );
- if( aFormsName.getLength() )
+ if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
{
uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
if( xControl.is() )
@@ -842,7 +855,7 @@ void SAL_CALL SvxShapeControl::setPropertyValue( const OUString& aPropertyName,
}
else if ( aFormsName.equalsAscii( "Align" ) )
{
- valueParaAdjustToAlign( aConvertedValue );
+ lcl_convertParaAdjustmentToTextAlignment( aConvertedValue );
}
else if ( aFormsName.equalsAscii( "VerticalAlign" ) )
{
@@ -863,8 +876,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyNa
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OUString aFormsName;
- convertPropertyName( aPropertyName, aFormsName );
- if( aFormsName.getLength() )
+ if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
{
uno::Reference< beans::XPropertySet > xControl( getControl(), uno::UNO_QUERY );
@@ -891,7 +903,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyNa
}
else if ( aFormsName.equalsAscii( "Align" ) )
{
- valueAlignToParaAdjust( aValue );
+ lcl_convertTextAlignmentToParaAdjustment( aValue );
}
else if ( aFormsName.equalsAscii( "VerticalAlign" ) )
{
@@ -913,8 +925,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyValue( const OUString& aPropertyNa
beans::PropertyState SAL_CALL SvxShapeControl::getPropertyState( const ::rtl::OUString& PropertyName ) throw( beans::UnknownPropertyException, uno::RuntimeException )
{
OUString aFormsName;
- convertPropertyName( PropertyName, aFormsName );
- if( aFormsName.getLength() )
+ if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
{
uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
@@ -939,8 +950,7 @@ beans::PropertyState SAL_CALL SvxShapeControl::getPropertyState( const ::rtl::OU
void SAL_CALL SvxShapeControl::setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw( beans::UnknownPropertyException, uno::RuntimeException )
{
OUString aFormsName;
- convertPropertyName( PropertyName, aFormsName );
- if( aFormsName.getLength() )
+ if ( lcl_convertPropertyName( PropertyName, aFormsName ) )
{
uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
uno::Reference< beans::XPropertySet > xPropSet( getControl(), uno::UNO_QUERY );
@@ -964,8 +974,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const ::rtl::OUString& aP
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
OUString aFormsName;
- convertPropertyName( aPropertyName, aFormsName );
- if( aFormsName.getLength() )
+ if ( lcl_convertPropertyName( aPropertyName, aFormsName ) )
{
uno::Reference< beans::XPropertyState > xControl( getControl(), uno::UNO_QUERY );
@@ -980,7 +989,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const ::rtl::OUString& aP
}
else if ( aFormsName.equalsAscii( "Align" ) )
{
- valueAlignToParaAdjust( aDefault );
+ lcl_convertTextAlignmentToParaAdjustment( aDefault );
}
else if ( aFormsName.equalsAscii( "VerticalAlign" ) )
{
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 9b44a67582f2..2cede47df320 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -156,7 +156,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
GMAP( "TextLowerDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
GMAP( "TextLeftDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
GMAP( "TextRightDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too
- PMAP( "TextWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_SD_TYPE_WRITINGMODE, CTF_WRITINGMODE ),
+ PMAP( "TextWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_SD_TYPE_WRITINGMODE|MID_FLAG_MULTI_PROPERTY, CTF_WRITINGMODE ),
GMAP( "NumberingRules", XML_NAMESPACE_TEXT, XML_LIST_STYLE, XML_SD_TYPE_NUMBULLET|MID_FLAG_ELEMENT_ITEM, CTF_NUMBERINGRULES ),
GMAP( "NumberingRules", XML_NAMESPACE_TEXT, XML_LIST_STYLE_NAME, XML_TYPE_STRING, CTF_SD_NUMBERINGRULES_NAME ),
GMAP( "TextWordWrap", XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_TYPE_WRAP_OPTION, 0 ),
@@ -267,6 +267,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
GMAP( "ControlDataStyle", XML_NAMESPACE_STYLE,XML_DATA_STYLE_NAME, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_EXPORT|MID_FLAG_SPECIAL_ITEM, CTF_SD_CONTROL_SHAPE_DATA_STYLE ),
GMAP( "ControlTextEmphasis", XML_NAMESPACE_STYLE,XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ),
GMAP( "ImageScaleMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_IMAGE_SCALE_MODE|MID_FLAG_MULTI_PROPERTY, 0 ),
+ GMAP( "ControlWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT|MID_FLAG_MULTI_PROPERTY, 0 ),
// special entries for floating frames
GMAP( "FrameIsAutoScroll", XML_NAMESPACE_DRAW, XML_FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ),
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index f034bdb0c834..d3e3edcd6716 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -345,7 +345,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
if (0 != sNumberStyle.getLength())
{
sal_Int32 nIndex = GetPropertySetMapper()->getPropertySetMapper()->FindEntryIndex(CTF_SD_CONTROL_SHAPE_DATA_STYLE);
- // TODO : this retrieval of the index should be moved into the ctor, holding the index
+ // TODO : this retrieval of the index could be moved into the ctor, holding the index
// as member, thus saving time.
DBG_ASSERT(-1 != nIndex, "XMLShapeExport::collectShapeAutoStyles: could not obtain the index for our context id!");
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 4c61da8fdf50..de9b63baf4bf 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -457,6 +457,8 @@ namespace xmloff
// the "VerticalAlign" property should have been exported at the shape, too
exportedProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VerticalAlign" ) ) );
+ // ditto the TextWritingMode
+ exportedProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ) );
}
//---------------------------------------------------------------------
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 72e90c7be47e..5d14026d4bd9 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -167,14 +167,7 @@ void XMLPropertyStates_Impl::FillPropertyStateVector(
if (nCount)
{
rVector.resize(nCount, XMLPropertyState(-1));
- XMLPropertyStateList_Impl::iterator aItr = aPropStates.begin();
- sal_Int32 i (0);
- while (aItr != aPropStates.end())
- {
- rVector[i] = *aItr;
- aItr++;
- i++;
- }
+ ::std::copy( aPropStates.begin(), aPropStates.end(), rVector.begin() );
}
}
@@ -447,7 +440,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
sal_uInt32 nValueCount = 0;
sal_uInt32 i;
- for( i = 0; i < nCount; i++, pStates++ )
+ for( i = 0; i < nCount; ++i, ++pStates )
{
if( (*pStates == PropertyState_DIRECT_VALUE)/* || (bDefault && (*pStates == PropertyState_DEFAULT_VALUE))*/ )
nValueCount++;
@@ -459,9 +452,8 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
Sequence < OUString > aAPINames( nValueCount );
OUString *pAPINames = aAPINames.getArray();
- FilterPropertyInfoList_Impl::iterator *aPropIters =
- new FilterPropertyInfoList_Impl::iterator[nValueCount];
- FilterPropertyInfoList_Impl::iterator *pPropIter = aPropIters;
+ ::std::vector< FilterPropertyInfoList_Impl::iterator > aPropIters;
+ aPropIters.reserve( nValueCount );
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
OSL_ENSURE(aItr != aPropInfos.end(),"Invalid iterator!");
@@ -473,35 +465,38 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
if( (*pStates == PropertyState_DIRECT_VALUE)/* || (bDefault && (*pStates == PropertyState_DEFAULT_VALUE))*/ )
{
*pAPINames++ = aItr->GetApiName();
- *pPropIter++ = aItr;
- i++;
+ aPropIters.push_back( aItr );
+ ++i;
}
- aItr++;
- pStates++;
+ ++aItr;
+ ++pStates;
}
aValues = xMultiPropSet->getPropertyValues( aAPINames );
const Any *pValues = aValues.getConstArray();
- pPropIter = aPropIters;
+
+ ::std::vector< FilterPropertyInfoList_Impl::iterator >::const_iterator
+ pPropIter = aPropIters.begin();
+
XMLPropertyState aNewProperty( -1 );
for( i = 0; i < nValueCount; i++ )
{
aNewProperty.mnIndex = -1;
aNewProperty.maValue = *pValues;
- for( std::list<sal_uInt32>::iterator aIndexItr =
- (*pPropIter)->GetIndexes().begin();
- aIndexItr != (*pPropIter)->GetIndexes().end();
- aIndexItr++ )
+ const ::std::list< sal_uInt32 >& rIndexes( (*pPropIter)->GetIndexes() );
+ for ( std::list<sal_uInt32>::const_iterator aIndexItr = rIndexes.begin();
+ aIndexItr != rIndexes.end();
+ ++aIndexItr
+ )
{
aNewProperty.mnIndex = *aIndexItr;
aPropStates.AddPropertyState( aNewProperty );
}
- pPropIter++;
- pValues++;
+ ++pPropIter;
+ ++pValues;
}
- delete[] aPropIters;
}
}
else
@@ -540,7 +535,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
// The value is stored in the PropertySet itself, add to list.
sal_Bool bGotValue = sal_False;
XMLPropertyState aNewProperty( -1 );
- for( std::list<sal_uInt32>::iterator aIndexItr =
+ for( std::list<sal_uInt32>::const_iterator aIndexItr =
aItr->GetIndexes().begin();
aIndexItr != aItr->GetIndexes().end();
aIndexItr++ )