diff options
27 files changed, 405 insertions, 177 deletions
diff --git a/extensions/inc/extensio.hrc b/extensions/inc/extensio.hrc index 96b8a6b08a5b..a831143b5eeb 100644 --- a/extensions/inc/extensio.hrc +++ b/extensions/inc/extensio.hrc @@ -456,10 +456,11 @@ #define HID_PROP_BORDERCOLOR (HID_FORMS_START + 337) #define UID_PROP_DLG_BORDERCOLOR (HID_FORMS_START + 338) #define HID_PROP_IMAGEPOSITION (HID_FORMS_START + 339) -#define HID_PROP_NOLABEL (HID_FORMS_START + 340) +#define HID_PROP_NOLABEL (HID_FORMS_START + 340) +#define HID_PROP_WRITING_MODE (HID_FORMS_START + 341) // please adjust HID_LAST_FORMS_ID if you add new ids here! -#define HID_LAST_FORMS_ID HID_PROP_NOLABEL +#define HID_LAST_FORMS_ID HID_PROP_WRITING_MODE #if HID_LAST_FORMS_ID > HID_FORMS_END #error id overflow diff --git a/extensions/source/propctrlr/controltype.hxx b/extensions/source/propctrlr/controltype.hxx index 1afcfd3ab5fc..4cde8d2c3e9d 100644 --- a/extensions/source/propctrlr/controltype.hxx +++ b/extensions/source/propctrlr/controltype.hxx @@ -30,6 +30,8 @@ #ifndef EXTENSIONS_SOURCE_PROPCTRLR_CONTROLTYPE_HXX #define EXTENSIONS_SOURCE_PROPCTRLR_CONTROLTYPE_HXX +#include <sal/types.h> + //........................................................................ namespace pcr { diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 11f464a8fde4..c413de6e7e44 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -30,24 +30,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" + +#include "controltype.hxx" +#include "extensio.hrc" +#include "fontdialog.hxx" #include "formcomponenthandler.hxx" +#include "formlinkdialog.hxx" #include "formmetadata.hxx" -#include "usercontrol.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif -#include "formstrings.hxx" -#ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" -#endif -#include "controltype.hxx" +#include "formstrings.hxx" +#include "handlerhelper.hxx" #include "listselectiondlg.hxx" -#include "formlinkdialog.hxx" -#include "fontdialog.hxx" +#include "pcrcommon.hxx" #include "selectlabeldialog.hxx" #include "taborder.hxx" -#include "pcrcommon.hxx" -#include "handlerhelper.hxx" +#include "usercontrol.hxx" /** === begin UNO includes === **/ #include <com/sun/star/lang/NullPointerException.hpp> @@ -81,39 +78,35 @@ #include <com/sun/star/resource/XStringResourceManager.hpp> #include <com/sun/star/resource/MissingResourceException.hpp> #include <com/sun/star/graphic/GraphicObject.hpp> +#include <com/sun/star/text/WritingMode2.hpp> /** === end UNO includes === **/ -#include <connectivity/dbexception.hxx> -#include <vcl/wrkwin.hxx> -#include <svtools/numuno.hxx> -#include <unotools/confignode.hxx> + #include <comphelper/extract.hxx> -#ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> -#endif -#include <toolkit/helper/vclunohelper.hxx> -#include <vcl/stdtext.hxx> -#include <svtools/itemset.hxx> -#include <svtools/numuno.hxx> +#include <connectivity/dbconversion.hxx> +#include <connectivity/dbexception.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <sfx2/app.hxx> -#ifndef _SVX_SVXIDS_HRC -#include <svx/svxids.hrc> -#endif -#include <svtools/intitem.hxx> -#include <svx/numinf.hxx> -#include <svx/svxdlg.hxx> -#ifndef _SVX_DIALOGS_HRC -#include <svx/dialogs.hrc> -#endif -#include <vcl/msgbox.hxx> -#include <sfx2/filedlghelper.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/docfilt.hxx> +#include <sfx2/filedlghelper.hxx> +#include <svtools/ctloptions.hxx> #include <svtools/colrdlg.hxx> -#include <svtools/urihelper.hxx> +#include <svtools/filenotation.hxx> +#include <svtools/intitem.hxx> +#include <svtools/itemset.hxx> #include <svtools/moduleoptions.hxx> +#include <svtools/numuno.hxx> +#include <svtools/urihelper.hxx> +#include <svx/dialogs.hrc> +#include <svx/numinf.hxx> +#include <svx/svxdlg.hxx> +#include <svx/svxids.hrc> +#include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> -#include <cppuhelper/exc_hlp.hxx> -#include <connectivity/dbconversion.hxx> +#include <unotools/confignode.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/stdtext.hxx> +#include <vcl/wrkwin.hxx> #include <tools/StringListResource.hxx> #include <limits> @@ -148,6 +141,8 @@ namespace pcr using namespace inspection; using namespace ::dbtools; + namespace WritingMode2 = ::com::sun::star::text::WritingMode2; + //==================================================================== //= FormComponentPropertyHandler //==================================================================== @@ -607,6 +602,28 @@ namespace pcr } break; + case PROPERTY_ID_WRITING_MODE: + { + aPropertyValue = FormComponentPropertyHandler_Base::convertToPropertyValue( _rPropertyName, _rControlValue ); + + sal_Int16 nNormalizedValue( 2 ); + OSL_VERIFY( aPropertyValue >>= nNormalizedValue ); + sal_Int16 nWritingMode = WritingMode2::CONTEXT; + switch ( nNormalizedValue ) + { + case 0: nWritingMode = WritingMode2::LR_TB; break; + case 1: nWritingMode = WritingMode2::RL_TB; break; + case 2: nWritingMode = WritingMode2::CONTEXT; break; + default: + OSL_ENSURE( false, "FormComponentPropertyHandler::convertToControlValue: unexpected 'normalized value' for WritingMode!" ); + nWritingMode = WritingMode2::CONTEXT; + break; + } + + aPropertyValue <<= nWritingMode; + } + break; + default: aPropertyValue = FormComponentPropertyHandler_Base::convertToPropertyValue( _rPropertyName, _rControlValue ); break; // default @@ -716,6 +733,26 @@ namespace pcr } break; + case PROPERTY_ID_WRITING_MODE: + { + sal_Int16 nWritingMode( WritingMode2::CONTEXT ); + OSL_VERIFY( _rPropertyValue >>= nWritingMode ); + sal_Int16 nNormalized = 2; + switch ( nWritingMode ) + { + case WritingMode2::LR_TB: nNormalized = 0; break; + case WritingMode2::RL_TB: nNormalized = 1; break; + case WritingMode2::CONTEXT: nNormalized = 2; break; + default: + OSL_ENSURE( false, "FormComponentPropertyHandler::convertToControlValue: unsupported API value for WritingMode!" ); + nNormalized = 2; + break; + } + + aControlValue = FormComponentPropertyHandler_Base::convertToControlValue( _rPropertyName, makeAny( nNormalized ), _rControlValueType ); + } + break; + default: aControlValue = FormComponentPropertyHandler_Base::convertToControlValue( _rPropertyName, _rPropertyValue, _rControlValueType ); break; @@ -2185,6 +2222,11 @@ namespace pcr // ScaleImage is superseded by ScaleMode return true; break; + + case PROPERTY_ID_WRITING_MODE: + if ( !SvtCTLOptions().IsCTLFontEnabled() ) + return true; + break; } sal_uInt32 nPropertyUIFlags = m_pInfoService->getPropertyUIFlags( _rProperty.Handle ); diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index ae452a566337..70ae992e7044 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -142,6 +142,7 @@ namespace pcr DEF_INFO_2( TITLE, TITLE, TITLE, FORM_VISIBLE, DIALOG_VISIBLE ), DEF_INFO_3( LABEL, LABEL, LABEL, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_2( CONTROLLABEL, LABELCONTROL, CONTROLLABEL, FORM_VISIBLE, COMPOSEABLE ), + DEF_INFO_3( WRITING_MODE, WRITING_MODE, WRITING_MODE, FORM_VISIBLE, ENUM, COMPOSEABLE ), DEF_INFO_2( TEXT, TEXT, TEXT, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( MAXTEXTLEN, MAXTEXTLEN, MAXTEXTLEN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), DEF_INFO_3( EDITMASK, EDITMASK, EDITMASK, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), @@ -508,6 +509,9 @@ namespace pcr case PROPERTY_ID_SCALE_MODE: nStringItemsResId = RID_RSC_ENUM_SCALE_MODE; break; + case PROPERTY_ID_WRITING_MODE: + nStringItemsResId = RID_RSC_ENUM_WRITING_MODE; + break; default: OSL_ENSURE( sal_False, "OPropertyInfoService::getPropertyEnumRepresentations: unknown enum property!" ); break; diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx index a86eac088c7f..b1b23153dbdb 100644 --- a/extensions/source/propctrlr/formmetadata.hxx +++ b/extensions/source/propctrlr/formmetadata.hxx @@ -339,6 +339,7 @@ namespace pcr #define PROPERTY_ID_NOLABEL 195 #define PROPERTY_ID_SCALE_MODE 196 #define PROPERTY_ID_INPUT_REQUIRED 197 + #define PROPERTY_ID_WRITING_MODE 198 //............................................................................ } // namespace pcr diff --git a/extensions/source/propctrlr/formres.src b/extensions/source/propctrlr/formres.src index c05934b60d65..3700667dd0e9 100644 --- a/extensions/source/propctrlr/formres.src +++ b/extensions/source/propctrlr/formres.src @@ -1409,3 +1409,24 @@ String RID_STR_INPUT_REQUIRED { Text [ en-US ] = "Input required"; }; + +String RID_STR_WRITING_MODE +{ + Text [ en-US ] = "Text direction"; +}; + +Resource RID_RSC_ENUM_WRITING_MODE +{ + String 1 + { + Text [ en-US ] = "Left-to-right"; + }; + String 2 + { + Text [ en-US ] = "Right-to-left"; + }; + String 3 + { + Text [ en-US ] = "Use superordinate object settings"; + }; +}; diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc index 5dadc9d2fa36..5f7544458d13 100644 --- a/extensions/source/propctrlr/formresid.hrc +++ b/extensions/source/propctrlr/formresid.hrc @@ -236,7 +236,7 @@ #define RID_STR_SHOW_SCROLLBARS ( RID_FORMBROWSER_START + 205 ) #define RID_STR_QUERYDESIGN_TITLE ( RID_FORMBROWSER_START + 206 ) #define RID_STR_ICONSIZE ( RID_FORMBROWSER_START + 207 ) - // FREE +#define RID_STR_WRITING_MODE ( RID_FORMBROWSER_START + 208 ) #define RID_STR_SHOW_POSITION ( RID_FORMBROWSER_START + 209 ) #define RID_STR_SHOW_NAVIGATION ( RID_FORMBROWSER_START + 210 ) #define RID_STR_SHOW_RECORDACTIONS ( RID_FORMBROWSER_START + 211 ) @@ -339,6 +339,7 @@ #define RID_RSC_ENUM_SCALE_MODE ( RID_PROPCONTROLLER_START + 26 ) #define RID_RSC_ENUM_YESNO ( RID_PROPCONTROLLER_START + 27 ) #define RID_RSC_ENUM_SHOWHIDE ( RID_PROPCONTROLLER_START + 28 ) +#define RID_RSC_ENUM_WRITING_MODE ( RID_PROPCONTROLLER_START + 26 ) // ----------------------------------------------------------------------- // - ImageList - local ids diff --git a/extensions/source/propctrlr/formstrings.hxx b/extensions/source/propctrlr/formstrings.hxx index 23f677a658bc..0d77b45bb6cf 100644 --- a/extensions/source/propctrlr/formstrings.hxx +++ b/extensions/source/propctrlr/formstrings.hxx @@ -262,6 +262,7 @@ namespace pcr PCR_CONSTASCII_STRING( PROPERTY_SUBMISSION_ID, "SubmissionID" ); PCR_CONSTASCII_STRING( PROPERTY_BINDING_ID, "BindingID" ); PCR_CONSTASCII_STRING( PROPERTY_ID, "ID" ); + PCR_CONSTASCII_STRING( PROPERTY_WRITING_MODE, "WritingMode" ); PCR_CONSTASCII_STRING( PROPERTY_MODEL, "Model" ); diff --git a/extensions/util/hidother.src b/extensions/util/hidother.src index e2c56da5d130..0b82734c645d 100644 --- a/extensions/util/hidother.src +++ b/extensions/util/hidother.src @@ -307,3 +307,4 @@ hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DES hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CANCEL; } hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; } hidspecial HID_PROP_INPUT_REQUIRED { HelpId = HID_PROP_INPUT_REQUIRED; } +hidspecial HID_PROP_WRITING_MODE { HelpId = HID_PROP_WRITING_MODE; } diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index eb5c032b9fc4..0ddab1faecdb 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -33,6 +33,7 @@ #include "Filter.hxx" +#include "FormComponent.hxx" #include "frm_module.hxx" #include "frm_resource.hrc" #include "frm_resource.hxx" @@ -203,66 +204,70 @@ namespace frm { UnoControl::createPeer( rxToolkit, rParentPeer ); - Reference< XVclWindowPeer > xVclWindow( getPeer(), UNO_QUERY ); - Any aValue; - if (xVclWindow.is()) + try { - switch (m_nControlClass) + Reference< XVclWindowPeer > xVclWindow( getPeer(), UNO_QUERY_THROW ); + switch ( m_nControlClass ) { case FormComponentType::CHECKBOX: { // checkboxes always have a tristate-mode - sal_Bool bB(sal_True); - aValue.setValue(&bB,::getBooleanCppuType()); - xVclWindow->setProperty(PROPERTY_TRISTATE, aValue); + xVclWindow->setProperty( PROPERTY_TRISTATE, makeAny( sal_Bool( sal_True ) ) ); + xVclWindow->setProperty( PROPERTY_STATE, makeAny( sal_Int32( STATE_DONTKNOW ) ) ); - aValue <<= (sal_Int32)STATE_DONTKNOW; - xVclWindow->setProperty(PROPERTY_STATE, aValue); + Reference< XCheckBox > xBox( getPeer(), UNO_QUERY_THROW ); + xBox->addItemListener( this ); - Reference< XCheckBox > xBox( getPeer(), UNO_QUERY ); - xBox->addItemListener(this); + } + break; - } break; case FormComponentType::RADIOBUTTON: { - aValue <<= (sal_Int32)STATE_NOCHECK; - xVclWindow->setProperty(PROPERTY_STATE, aValue); + xVclWindow->setProperty( PROPERTY_STATE, makeAny( sal_Int32( STATE_NOCHECK ) ) ); + + Reference< XRadioButton > xRadio( getPeer(), UNO_QUERY_THROW ); + xRadio->addItemListener( this ); + } + break; - Reference< XRadioButton > xRadio( getPeer(), UNO_QUERY ); - xRadio->addItemListener(this); - } break; case FormComponentType::LISTBOX: { - Reference< XListBox > xListBox( getPeer(), UNO_QUERY ); - xListBox->addItemListener(this); + Reference< XListBox > xListBox( getPeer(), UNO_QUERY_THROW ); + xListBox->addItemListener( this ); } - case FormComponentType::COMBOBOX: // no break; + // no break + + case FormComponentType::COMBOBOX: { - sal_Bool bB(sal_True); - aValue.setValue(&bB,::getBooleanCppuType()); - xVclWindow->setProperty(PROPERTY_AUTOCOMPLETE, aValue); + xVclWindow->setProperty(PROPERTY_AUTOCOMPLETE, makeAny( sal_Bool( sal_True ) ) ); } - default: // no break; + // no break + + default: { Reference< XWindow > xWindow( getPeer(), UNO_QUERY ); - xWindow->addFocusListener(this); + xWindow->addFocusListener( this ); Reference< XTextComponent > xText( getPeer(), UNO_QUERY ); if (xText.is()) xText->setMaxTextLen(0); - } break; + } + break; } - } - // filter controls are _never_ readonly - // #107013# - 2002-02-03 - fs@openoffice.org - Reference< XPropertySet > xModel( getModel(), UNO_QUERY ); - OSL_ENSURE( xModel.is(), "OFilterControl::createPeer: no model!" ); - Reference< XPropertySetInfo > xModelPSI; - if ( xModel.is() ) - xModelPSI = xModel->getPropertySetInfo(); - if ( xModelPSI.is() && xModelPSI->hasPropertyByName( PROPERTY_READONLY ) ) - xVclWindow->setProperty( PROPERTY_READONLY, makeAny( sal_False ) ); + OControl::initFormControlPeer( getPeer() ); + + // filter controls are _never_ readonly + // #107013# - 2002-02-03 - fs@openoffice.org + Reference< XPropertySet > xModel( getModel(), UNO_QUERY_THROW ); + Reference< XPropertySetInfo > xModelPSI( xModel->getPropertySetInfo(), UNO_SET_THROW ); + if ( xModelPSI->hasPropertyByName( PROPERTY_READONLY ) ) + xVclWindow->setProperty( PROPERTY_READONLY, makeAny( sal_Bool( sal_False ) ) ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } if (m_bFilterList) m_bFilterListFilled = sal_False; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 5465b1199eaa..4b1bc5515836 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -182,6 +182,25 @@ Sequence<Type> OControl::_getTypes() return TypeBag( OComponentHelper::getTypes(), OControl_BASE::getTypes() ).getTypes(); } +//------------------------------------------------------------------------------ +void OControl::initFormControlPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _rxPeer ) +{ + try + { + Reference< XVclWindowPeer > xVclWindowPeer( _rxPeer, UNO_QUERY_THROW ); + + // #i63103# - form controls should only react on the mouse wheel when they're focused + xVclWindowPeer->setProperty( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WheelWithoutFocus" ) ), + makeAny( sal_Bool( sal_False ) ) + ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + // OComponentHelper //------------------------------------------------------------------------------ void OControl::disposing() @@ -287,13 +306,7 @@ void SAL_CALL OControl::createPeer(const Reference<XToolkit>& _rxToolkit, const { m_xControl->createPeer( _rxToolkit, _rxParent ); - // #i63103# - form controls should only react on the mouse wheel when they're focused - Reference< XVclWindowPeer > xVclWindowPeer( getPeer(), UNO_QUERY ); - if ( xVclWindowPeer.is() ) - xVclWindowPeer->setProperty( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WheelWithoutFocus" ) ), - makeAny( (sal_Bool)sal_False ) - ); + initFormControlPeer( getPeer() ); impl_resetStateGuard_nothrow(); } diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 1c0d61b907ac..270fa2c9547e 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -31,26 +31,26 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" -#include "Grid.hxx" #include "Columns.hxx" #include "findpos.hxx" +#include "Grid.hxx" +#include "property.hrc" +#include "property.hxx" +#include "services.hxx" + +/** === begin UNO includes === **/ #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XLoadable.hpp> -#include "services.hxx" -#ifndef _FRM_PROPERTY_HRC_ -#include "property.hrc" -#endif -#include "property.hxx" -#include <cppuhelper/queryinterface.hxx> -#include <comphelper/extract.hxx> -#include <comphelper/container.hxx> -#include <comphelper/basicio.hxx> -#include <vcl/svapp.hxx> +#include <com/sun/star/text/WritingMode2.hpp> +/** === end UNO includes === **/ -#ifndef _TOOLKIT_UNOHLP_HXX +#include <comphelper/basicio.hxx> +#include <comphelper/container.hxx> +#include <comphelper/extract.hxx> +#include <cppuhelper/queryinterface.hxx> #include <toolkit/helper/vclunohelper.hxx> -#endif +#include <vcl/svapp.hxx> using namespace ::com::sun::star::uno; @@ -72,6 +72,8 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; using namespace ::com::sun::star::view; +namespace WritingMode2 = ::com::sun::star::text::WritingMode2; + const sal_uInt16 ROWHEIGHT = 0x0001; const sal_uInt16 FONTTYPE = 0x0002; const sal_uInt16 FONTSIZE = 0x0004; @@ -99,6 +101,8 @@ OGridControlModel::OGridControlModel(const Reference<XMultiServiceFactory>& _rxF ,m_aResetListeners(m_aMutex) ,m_aDefaultControl( FRM_SUN_CONTROL_GRIDCONTROL ) ,m_nBorder(1) + ,m_nWritingMode( WritingMode2::CONTEXT ) + ,m_nContextWritingMode( WritingMode2::CONTEXT ) ,m_bEnable(sal_True) ,m_bNavigation(sal_True) ,m_bRecordMarker(sal_True) @@ -126,6 +130,8 @@ OGridControlModel::OGridControlModel( const OGridControlModel* _pOriginal, const m_bEnable = _pOriginal->m_bEnable; m_bNavigation = _pOriginal->m_bNavigation; m_nBorder = _pOriginal->m_nBorder; + m_nWritingMode = _pOriginal->m_nWritingMode; + m_nContextWritingMode = _pOriginal->m_nContextWritingMode; m_bRecordMarker = _pOriginal->m_bRecordMarker; m_bPrintable = _pOriginal->m_bPrintable; m_bAlwaysShowCursor = _pOriginal->m_bAlwaysShowCursor; @@ -409,7 +415,7 @@ void OGridControlModel::_reset() //------------------------------------------------------------------------------ void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const { - BEGIN_DESCRIBE_BASE_PROPERTIES( 34 ) + BEGIN_DESCRIBE_BASE_PROPERTIES( 36 ) DECL_PROP1(NAME, ::rtl::OUString, BOUND); DECL_PROP2(CLASSID, sal_Int16, READONLY, TRANSIENT); DECL_PROP1(TAG, ::rtl::OUString, BOUND); @@ -444,6 +450,8 @@ void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) DECL_PROP3(ALWAYSSHOWCURSOR, sal_Bool, BOUND, MAYBEDEFAULT, TRANSIENT); DECL_PROP3(DISPLAYSYNCHRON, sal_Bool, BOUND, MAYBEDEFAULT, TRANSIENT); DECL_PROP2(HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT); + DECL_PROP2(WRITING_MODE, sal_Int16, BOUND, MAYBEDEFAULT); + DECL_PROP3(CONTEXT_WRITING_MODE,sal_Int16, BOUND, MAYBEDEFAULT, TRANSIENT); END_DESCRIBE_PROPERTIES(); } @@ -452,6 +460,12 @@ void OGridControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) co { switch (nHandle) { + case PROPERTY_ID_CONTEXT_WRITING_MODE: + rValue <<= m_nContextWritingMode; + break; + case PROPERTY_ID_WRITING_MODE: + rValue <<= m_nWritingMode; + break; case PROPERTY_ID_HELPTEXT: rValue <<= m_sHelpText; break; @@ -513,6 +527,12 @@ sal_Bool OGridControlModel::convertFastPropertyValue( Any& rConvertedValue, Any& sal_Bool bModified(sal_False); switch (nHandle) { + case PROPERTY_ID_CONTEXT_WRITING_MODE: + bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_nContextWritingMode ); + break; + case PROPERTY_ID_WRITING_MODE: + bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_nWritingMode ); + break; case PROPERTY_ID_HELPTEXT: bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_sHelpText); break; @@ -592,6 +612,12 @@ void OGridControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con { switch (nHandle) { + case PROPERTY_ID_CONTEXT_WRITING_MODE: + rValue >>= m_nContextWritingMode; + break; + case PROPERTY_ID_WRITING_MODE: + rValue >>= m_nWritingMode; + break; case PROPERTY_ID_HELPTEXT: rValue >>= m_sHelpText; break; @@ -662,6 +688,11 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const Any aReturn; switch (nHandle) { + case PROPERTY_ID_CONTEXT_WRITING_MODE: + case PROPERTY_ID_WRITING_MODE: + aReturn <<= WritingMode2::CONTEXT; + break; + case PROPERTY_ID_DEFAULTCONTROL: aReturn <<= ::rtl::OUString( STARDIV_ONE_FORM_CONTROL_GRID ); break; @@ -956,15 +987,7 @@ void OGridControlModel::write(const Reference<XObjectOutputStream>& _rxOutStream _rxOutStream->writeShort( aFont.Pitch ); } - // no need to write a compatible service name anymore: Since the binfilter workspace, this - // code here is not used anymore for writing old binary file formats. Thus, there's no need - // to be compatible to anything except ourself. - // 2004-07-26 - #i31138# - fs@openoffice.org -// if ( m_aDefaultControl == FRM_SUN_CONTROL_GRIDCONTROL ) -// // for compatibility, write a sevice name which older versions understand (up to 5.1) -// _rxOutStream << STARDIV_ONE_FORM_CONTROL_GRID; -// else - _rxOutStream << m_aDefaultControl; + _rxOutStream << m_aDefaultControl; _rxOutStream->writeShort(m_nBorder); _rxOutStream->writeBoolean(m_bEnable); diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx index d43dc71d3c98..716f1a4ca739 100644 --- a/forms/source/component/Grid.hxx +++ b/forms/source/component/Grid.hxx @@ -92,12 +92,14 @@ class OGridControlModel :public OControlModel // [properties] ::rtl::OUString m_sHelpURL; // URL sal_Int16 m_nBorder; + sal_Int16 m_nWritingMode; + sal_Int16 m_nContextWritingMode; sal_Bool m_bEnable : 1; sal_Bool m_bNavigation : 1; sal_Bool m_bRecordMarker : 1; sal_Bool m_bPrintable : 1; sal_Bool m_bAlwaysShowCursor : 1; // transient - sal_Bool m_bDisplaySynchron : 1; // transient + sal_Bool m_bDisplaySynchron : 1; // transient // [properties] protected: diff --git a/forms/source/component/navigationbar.cxx b/forms/source/component/navigationbar.cxx index 60bbdfcbed75..236f64f762a8 100644 --- a/forms/source/component/navigationbar.cxx +++ b/forms/source/component/navigationbar.cxx @@ -32,6 +32,9 @@ #include "precompiled_forms.hxx" #include "navigationbar.hxx" #include "frm_module.hxx" + +#include <com/sun/star/text/WritingMode2.hpp> + #include <comphelper/streamsection.hxx> #include <comphelper/basicio.hxx> @@ -56,9 +59,7 @@ namespace frm using namespace ::com::sun::star::container; using namespace ::comphelper; -#define REGISTER_PROP( prop, member ) \ - registerProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, \ - &member, ::getCppuType( &member ) ); + namespace WritingMode2 = ::com::sun::star::text::WritingMode2; #define REGISTER_VOID_PROP( prop, memberAny, type ) \ registerMayBeVoidProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | PropertyAttribute::MAYBEVOID, \ @@ -78,15 +79,17 @@ namespace frm m_nClassId = FormComponentType::NAVIGATIONBAR; implInitPropertyContainer(); - getPropertyDefaultByHandle( PROPERTY_ID_DEFAULTCONTROL ) >>= m_sDefaultControl; - getPropertyDefaultByHandle( PROPERTY_ID_ICONSIZE ) >>= m_nIconSize; - getPropertyDefaultByHandle( PROPERTY_ID_BORDER ) >>= m_nBorder; - getPropertyDefaultByHandle( PROPERTY_ID_DELAY ) >>= m_nDelay; - getPropertyDefaultByHandle( PROPERTY_ID_ENABLED ) >>= m_bEnabled; - getPropertyDefaultByHandle( PROPERTY_ID_SHOW_POSITION ) >>= m_bShowPosition; - getPropertyDefaultByHandle( PROPERTY_ID_SHOW_NAVIGATION ) >>= m_bShowNavigation; - getPropertyDefaultByHandle( PROPERTY_ID_SHOW_RECORDACTIONS ) >>= m_bShowActions; - getPropertyDefaultByHandle( PROPERTY_ID_SHOW_FILTERSORT ) >>= m_bShowFilterSort; + getPropertyDefaultByHandle( PROPERTY_ID_DEFAULTCONTROL ) >>= m_sDefaultControl; + getPropertyDefaultByHandle( PROPERTY_ID_ICONSIZE ) >>= m_nIconSize; + getPropertyDefaultByHandle( PROPERTY_ID_BORDER ) >>= m_nBorder; + getPropertyDefaultByHandle( PROPERTY_ID_DELAY ) >>= m_nDelay; + getPropertyDefaultByHandle( PROPERTY_ID_ENABLED ) >>= m_bEnabled; + getPropertyDefaultByHandle( PROPERTY_ID_SHOW_POSITION ) >>= m_bShowPosition; + getPropertyDefaultByHandle( PROPERTY_ID_SHOW_NAVIGATION ) >>= m_bShowNavigation; + getPropertyDefaultByHandle( PROPERTY_ID_SHOW_RECORDACTIONS ) >>= m_bShowActions; + getPropertyDefaultByHandle( PROPERTY_ID_SHOW_FILTERSORT ) >>= m_bShowFilterSort; + getPropertyDefaultByHandle( PROPERTY_ID_WRITING_MODE ) >>= m_nWritingMode; + getPropertyDefaultByHandle( PROPERTY_ID_CONTEXT_WRITING_MODE ) >>= m_nContextWritingMode; } //------------------------------------------------------------------ @@ -98,35 +101,39 @@ namespace frm implInitPropertyContainer(); - m_aTabStop = _pOriginal->m_aTabStop; - m_aBackgroundColor = _pOriginal->m_aBackgroundColor; - m_sDefaultControl = _pOriginal->m_sDefaultControl; - m_sHelpText = _pOriginal->m_sHelpText; - m_sHelpURL = _pOriginal->m_sHelpURL; - m_bEnabled = _pOriginal->m_bEnabled; - m_nIconSize = _pOriginal->m_nIconSize; - m_nBorder = _pOriginal->m_nBorder; - m_nDelay = _pOriginal->m_nDelay; - m_bShowPosition = _pOriginal->m_bShowPosition; - m_bShowNavigation = _pOriginal->m_bShowNavigation; - m_bShowActions = _pOriginal->m_bShowActions; - m_bShowFilterSort = _pOriginal->m_bShowFilterSort; + m_aTabStop = _pOriginal->m_aTabStop; + m_aBackgroundColor = _pOriginal->m_aBackgroundColor; + m_sDefaultControl = _pOriginal->m_sDefaultControl; + m_sHelpText = _pOriginal->m_sHelpText; + m_sHelpURL = _pOriginal->m_sHelpURL; + m_bEnabled = _pOriginal->m_bEnabled; + m_nIconSize = _pOriginal->m_nIconSize; + m_nBorder = _pOriginal->m_nBorder; + m_nDelay = _pOriginal->m_nDelay; + m_bShowPosition = _pOriginal->m_bShowPosition; + m_bShowNavigation = _pOriginal->m_bShowNavigation; + m_bShowActions = _pOriginal->m_bShowActions; + m_bShowFilterSort = _pOriginal->m_bShowFilterSort; + m_nWritingMode = _pOriginal->m_nWritingMode; + m_nContextWritingMode = _pOriginal->m_nContextWritingMode; } //------------------------------------------------------------------ void ONavigationBarModel::implInitPropertyContainer() { - REGISTER_PROP( DEFAULTCONTROL, m_sDefaultControl ); - REGISTER_PROP( HELPTEXT, m_sHelpText ); - REGISTER_PROP( HELPURL, m_sHelpURL ); - REGISTER_PROP( ENABLED, m_bEnabled ); - REGISTER_PROP( ICONSIZE, m_nIconSize ); - REGISTER_PROP( BORDER, m_nBorder ); - REGISTER_PROP( DELAY, m_nDelay ); - REGISTER_PROP( SHOW_POSITION, m_bShowPosition ); - REGISTER_PROP( SHOW_NAVIGATION, m_bShowNavigation ); - REGISTER_PROP( SHOW_RECORDACTIONS, m_bShowActions ); - REGISTER_PROP( SHOW_FILTERSORT, m_bShowFilterSort ); + REGISTER_PROP_2( DEFAULTCONTROL, m_sDefaultControl, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( HELPTEXT, m_sHelpText, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( HELPURL, m_sHelpURL, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( ENABLED, m_bEnabled, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( ICONSIZE, m_nIconSize, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( BORDER, m_nBorder, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( DELAY, m_nDelay, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( SHOW_POSITION, m_bShowPosition, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( SHOW_NAVIGATION, m_bShowNavigation, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( SHOW_RECORDACTIONS, m_bShowActions, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( SHOW_FILTERSORT, m_bShowFilterSort, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( WRITING_MODE, m_nWritingMode, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_3( CONTEXT_WRITING_MODE,m_nContextWritingMode, BOUND, MAYBEDEFAULT, TRANSIENT ); REGISTER_VOID_PROP( TABSTOP, m_aTabStop, sal_Bool ); REGISTER_VOID_PROP( BACKGROUNDCOLOR, m_aBackgroundColor, sal_Int32 ); @@ -431,6 +438,10 @@ namespace frm case PROPERTY_ID_BACKGROUNDCOLOR: /* void */ break; + case PROPERTY_ID_WRITING_MODE: + case PROPERTY_ID_CONTEXT_WRITING_MODE: + aDefault <<= WritingMode2::CONTEXT; + break; case PROPERTY_ID_ENABLED: case PROPERTY_ID_SHOW_POSITION: diff --git a/forms/source/component/navigationbar.hxx b/forms/source/component/navigationbar.hxx index 7be96840699c..a1f525e61980 100644 --- a/forms/source/component/navigationbar.hxx +++ b/forms/source/component/navigationbar.hxx @@ -74,6 +74,8 @@ namespace frm sal_Bool m_bShowNavigation; sal_Bool m_bShowActions; sal_Bool m_bShowFilterSort; + sal_Int16 m_nWritingMode; + sal_Int16 m_nContextWritingMode; // </properties> public: diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx index 4b79262caf30..d396cbd2df6a 100644 --- a/forms/source/inc/FormComponent.hxx +++ b/forms/source/inc/FormComponent.hxx @@ -160,9 +160,14 @@ public: const sal_Bool _bSetDelegator = sal_True ); - virtual ~OControl(); + /** initializes the given peer with various settings necessary for form controls + */ + static void initFormControlPeer( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _rxPeer ); protected: + virtual ~OControl(); + /** sets the control as delegator at the aggregate This has to be called from within your derived class' constructor, if and only diff --git a/forms/source/inc/forms_module.hxx b/forms/source/inc/forms_module.hxx index af41250fc340..5b889fd2f9f5 100644 --- a/forms/source/inc/forms_module.hxx +++ b/forms/source/inc/forms_module.hxx @@ -309,6 +309,27 @@ namespace FORMS_MODULE_NAMESPACE ); \ } \ + #define IMPLEMENT_SERVICE_REGISTRATION_8( classname, baseclass, service1, service2, service3, service4 , service5, service6, service7, service8 ) \ + IMPLEMENT_SERVICE_REGISTRATION_BASE( classname, baseclass ) \ + \ + Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames_Static() \ + { \ + Sequence< ::rtl::OUString > aOwnNames( 8 ); \ + aOwnNames[ 0 ] = service1; \ + aOwnNames[ 1 ] = service2; \ + aOwnNames[ 2 ] = service3; \ + aOwnNames[ 3 ] = service4; \ + aOwnNames[ 4 ] = service5; \ + aOwnNames[ 5 ] = service6; \ + aOwnNames[ 6 ] = service7; \ + aOwnNames[ 6 ] = service8; \ + \ + return ::comphelper::concatSequences( \ + baseclass::getSupportedServiceNames_Static(), \ + aOwnNames \ + ); \ + } \ + //......................................................................... } // namespace FORMS_MODULE_NAMESPACE //......................................................................... diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx index 572bacf46ae4..13fbf9723eeb 100644 --- a/forms/source/inc/frm_strings.hxx +++ b/forms/source/inc/frm_strings.hxx @@ -276,6 +276,8 @@ namespace frm FORMS_CONSTASCII_STRING( PROPERTY_RICH_TEXT, "RichText" ); FORMS_CONSTASCII_STRING( PROPERTY_ENFORCE_FORMAT, "EnforceFormat" ); FORMS_CONSTASCII_STRING( PROPERTY_LINEEND_FORMAT, "LineEndFormat" ); + FORMS_CONSTASCII_STRING( PROPERTY_WRITING_MODE, "WritingMode" ); + FORMS_CONSTASCII_STRING( PROPERTY_CONTEXT_WRITING_MODE, "ContextWritingMode" ); FORMS_CONSTASCII_STRING( PROPERTY_NATIVE_LOOK, "NativeWidgetLook" ); FORMS_CONSTASCII_STRING( PROPERTY_BORDER, "Border" ); diff --git a/forms/source/inc/property.hrc b/forms/source/inc/property.hrc index c7d05d28f2ee..065a46eb5b8c 100644 --- a/forms/source/inc/property.hrc +++ b/forms/source/inc/property.hrc @@ -61,8 +61,8 @@ namespace frm #define PROPERTY_ID_ALLOWDELETIONS (PROPERTY_ID_START + 17) #define PROPERTY_ID_NATIVE_LOOK (PROPERTY_ID_START + 18) #define PROPERTY_ID_INPUT_REQUIRED (PROPERTY_ID_START + 19) - // free - // free +#define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20) +#define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21) // free // free // free diff --git a/forms/source/inc/property.hxx b/forms/source/inc/property.hxx index 4c3ffc065eed..062c1f951476 100644 --- a/forms/source/inc/property.hxx +++ b/forms/source/inc/property.hxx @@ -218,6 +218,10 @@ public: registerProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::attrib1 | PropertyAttribute::attrib2, \ &member, ::getCppuType( &member ) ); +#define REGISTER_PROP_3( prop, member, attrib1, attrib2, attrib3 ) \ + registerProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::attrib1 | PropertyAttribute::attrib2 | PropertyAttribute::attrib3, \ + &member, ::getCppuType( &member ) ); + //------------------------------------------------------------------------------ #define REGISTER_VOID_PROP_1( prop, memberAny, type, attrib1 ) \ registerMayBeVoidProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::MAYBEVOID | PropertyAttribute::attrib1, \ diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx index b8c5defa8263..a47b7b73b706 100644 --- a/forms/source/misc/property.cxx +++ b/forms/source/misc/property.cxx @@ -241,6 +241,8 @@ void PropertyInfoService::initialize() ADD_PROP_ASSIGNMENT(SPIN_VALUE); ADD_PROP_ASSIGNMENT(DEFAULT_SCROLL_VALUE); ADD_PROP_ASSIGNMENT(DEFAULT_SPIN_VALUE); + ADD_PROP_ASSIGNMENT( WRITING_MODE ); + ADD_PROP_ASSIGNMENT( CONTEXT_WRITING_MODE ); // now sort the array by name diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index 5c26d277dd5f..43f784f2219c 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -37,9 +37,7 @@ #endif #include "services.hxx" -#ifndef FORMS_SOURCE_RICHTEXT_RICHTEXTMODEL_CXX #include "richtextmodel.hxx" -#endif #include "richtextvclcontrol.hxx" #include "clipboarddispatcher.hxx" #include "parametrizedattributedispatcher.hxx" @@ -48,12 +46,10 @@ /** === begin UNO includes === **/ #include <com/sun/star/awt/PosSize.hpp> /** === end UNO includes === **/ -#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #include <svx/editview.hxx> #include <svtools/itemset.hxx> #include <svtools/itempool.hxx> @@ -203,7 +199,7 @@ namespace frm } catch( const Exception& ) { - DBG_ERROR( "::getWinBits: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return nBits; } @@ -215,18 +211,18 @@ namespace frm sal_Bool bReallyActAsRichText = sal_False; try { - Reference< XPropertySet > xModelProps( getModel(), UNO_QUERY ); - if ( xModelProps.is() ) - xModelProps->getPropertyValue( PROPERTY_RICH_TEXT ) >>= bReallyActAsRichText; + Reference< XPropertySet > xModelProps( getModel(), UNO_QUERY_THROW ); + xModelProps->getPropertyValue( PROPERTY_RICH_TEXT ) >>= bReallyActAsRichText; } catch( const Exception& ) { - OSL_ENSURE( sal_False, "ORichTextControl::createPeer: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } if ( !bReallyActAsRichText ) { UnoEditControl::createPeer( _rToolkit, _rParentPeer ); + OControl::initFormControlPeer( getPeer() ); return; } @@ -279,6 +275,8 @@ namespace frm } mbCreatingPeer = sal_False; + + OControl::initFormControlPeer( getPeer() ); } } diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index dced82ab7010..9f4a150ae1cd 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -39,6 +39,7 @@ /** === begin UNO includes === **/ #include <com/sun/star/awt/LineEndFormat.hpp> +#include <com/sun/star/text/WritingMode2.hpp> /** === end UNO includes === **/ #include <cppuhelper/typeprovider.hxx> #include <comphelper/guarding.hxx> @@ -67,6 +68,8 @@ namespace frm using namespace ::com::sun::star::form; using namespace ::com::sun::star::util; + namespace WritingMode2 = ::com::sun::star::text::WritingMode2; + //==================================================================== //= ORichTextModel //==================================================================== @@ -97,6 +100,8 @@ namespace frm getPropertyDefaultByHandle( PROPERTY_ID_RICH_TEXT ) >>= m_bReallyActAsRichText; getPropertyDefaultByHandle( PROPERTY_ID_HIDEINACTIVESELECTION ) >>= m_bHideInactiveSelection; getPropertyDefaultByHandle( PROPERTY_ID_LINEEND_FORMAT ) >>= m_nLineEndFormat; + getPropertyDefaultByHandle( PROPERTY_ID_WRITING_MODE ) >>= m_nTextWritingMode; + getPropertyDefaultByHandle( PROPERTY_ID_CONTEXT_WRITING_MODE ) >>= m_nContextWritingMode; implInit(); } @@ -127,6 +132,8 @@ namespace frm m_bReallyActAsRichText = _pOriginal->m_bReallyActAsRichText; m_bHideInactiveSelection = _pOriginal->m_bHideInactiveSelection; m_nLineEndFormat = _pOriginal->m_nLineEndFormat; + m_nTextWritingMode = _pOriginal->m_nTextWritingMode; + m_nContextWritingMode = _pOriginal->m_nContextWritingMode; m_aAlign = _pOriginal->m_aAlign; m_nEchoChar = _pOriginal->m_nEchoChar; @@ -196,12 +203,14 @@ namespace frm REGISTER_VOID_PROP_2( BORDERCOLOR, m_aBorderColor, sal_Int32, BOUND, MAYBEDEFAULT ); // properties which exist only for compatibility with the css.swt.UnoControlEditModel, - // since we intend to replace the default implementation for this service - REGISTER_PROP_2( ECHO_CHAR, m_nEchoChar, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( MAXTEXTLEN, m_nMaxTextLength, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( MULTILINE, m_bMultiLine, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( TEXT, m_sLastKnownEngineText, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( LINEEND_FORMAT, m_nLineEndFormat, BOUND, MAYBEDEFAULT ); + // since we replace the default implementation for this service + REGISTER_PROP_2( ECHO_CHAR, m_nEchoChar, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( MAXTEXTLEN, m_nMaxTextLength, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( MULTILINE, m_bMultiLine, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( TEXT, m_sLastKnownEngineText, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( LINEEND_FORMAT, m_nLineEndFormat, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_2( WRITING_MODE, m_nTextWritingMode, BOUND, MAYBEDEFAULT ); + REGISTER_PROP_3( CONTEXT_WRITING_MODE, m_nContextWritingMode, BOUND, MAYBEDEFAULT, TRANSIENT ); REGISTER_VOID_PROP_2( ALIGN, m_aAlign, sal_Int16, BOUND, MAYBEDEFAULT ); } @@ -239,14 +248,15 @@ namespace frm IMPLEMENT_FORWARD_XTYPEPROVIDER2( ORichTextModel, OControlModel, ORichTextModel_BASE ) //-------------------------------------------------------------------- - IMPLEMENT_SERVICE_REGISTRATION_7( ORichTextModel, OControlModel, + IMPLEMENT_SERVICE_REGISTRATION_8( ORichTextModel, OControlModel, FRM_SUN_COMPONENT_RICHTEXTCONTROL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextRange" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.CharacterProperties" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.ParagraphProperties" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.CharacterPropertiesAsian" ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.CharacterPropertiesComplex" ) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.ParagraphPropertiesAsian" ) ) + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.ParagraphPropertiesAsian" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.ParagraphPropertiesComplex" ) ) ) //------------------------------------------------------------------------------ @@ -305,6 +315,10 @@ namespace frm // our FormControlFont base class. We remove it from the base class' sequence // here, and later on care for both instances being in sync lcl_removeProperty( _rAggregateProps, PROPERTY_FONT ); + + // similar, the WritingMode property is declared in our aggregate, too, but we override + // it, since the aggregate does no proper PropertyState handling. + lcl_removeProperty( _rAggregateProps, PROPERTY_WRITING_MODE ); } //-------------------------------------------------------------------- @@ -352,30 +366,36 @@ namespace frm { OPropertyContainerHelper::setFastPropertyValue( _nHandle, _rValue ); - if ( PROPERTY_ID_REFERENCE_DEVICE == _nHandle ) + switch ( _nHandle ) { -#if OSL_DEBUG_LEVEL > 0 + case PROPERTY_ID_REFERENCE_DEVICE: + { + #if OSL_DEBUG_LEVEL > 0 MapMode aOldMapMode = m_pEngine->GetRefDevice()->GetMapMode(); -#endif + #endif OutputDevice* pRefDevice = VCLUnoHelper::GetOutputDevice( m_xReferenceDevice ); OSL_ENSURE( pRefDevice, "ORichTextModel::setFastPropertyValue_NoBroadcast: empty reference device?" ); m_pEngine->SetRefDevice( pRefDevice ); -#if OSL_DEBUG_LEVEL > 0 + #if OSL_DEBUG_LEVEL > 0 MapMode aNewMapMode = m_pEngine->GetRefDevice()->GetMapMode(); OSL_ENSURE( aNewMapMode.GetMapUnit() == aOldMapMode.GetMapUnit(), "ORichTextModel::setFastPropertyValue_NoBroadcast: You should not tamper with the MapUnit of the ref device!" ); // if this assertion here is triggered, then we would need to adjust all // items in all text portions in all paragraphs in the attributes of the EditEngine, // as long as they are MapUnit-dependent. This holds at least for the FontSize. -#endif + #endif } - else if ( PROPERTY_ID_TEXT == _nHandle ) + break; + + case PROPERTY_ID_TEXT: { MutexRelease aReleaseMutex( m_aMutex ); impl_smlock_setEngineText( m_sLastKnownEngineText ); } + break; + } // switch ( _nHandle ) } else if ( isFontRelatedProperty( _nHandle ) ) { @@ -388,7 +408,21 @@ namespace frm } else { - OControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + switch ( _nHandle ) + { + case PROPERTY_ID_WRITING_MODE: + { + // forward to our aggregate, so the EditEngine knows about it + if ( m_xAggregateSet.is() ) + m_xAggregateSet->setPropertyValue( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ), _rValue ); + } + break; + + default: + OControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue ); + break; + } } } @@ -399,6 +433,11 @@ namespace frm switch ( _nHandle ) { + case PROPERTY_ID_WRITING_MODE: + case PROPERTY_ID_CONTEXT_WRITING_MODE: + aDefault <<= WritingMode2::CONTEXT; + break; + case PROPERTY_ID_LINEEND_FORMAT: aDefault <<= (sal_Int16)LineEndFormat::LINE_FEED; break; diff --git a/forms/source/richtext/richtextmodel.hxx b/forms/source/richtext/richtextmodel.hxx index 2583d09c24a9..b124f76c4237 100644 --- a/forms/source/richtext/richtextmodel.hxx +++ b/forms/source/richtext/richtextmodel.hxx @@ -79,6 +79,8 @@ namespace frm ::rtl::OUString m_sHelpURL; ::rtl::OUString m_sLastKnownEngineText; sal_Int16 m_nLineEndFormat; + sal_Int16 m_nTextWritingMode; + sal_Int16 m_nContextWritingMode; sal_Int16 m_nBorder; sal_Bool m_bEnabled; sal_Bool m_bHardLineBreaks; diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index b474e54e0fc0..88995b49f4a8 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -30,17 +30,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_forms.hxx" + #include "navbarcontrol.hxx" #include "frm_strings.hxx" #include "frm_module.hxx" -#include <tools/debug.hxx> +#include "navtoolbar.hxx" +#include "FormComponent.hxx" + +/** === begin UNO includes === **/ #include <com/sun/star/awt/XView.hpp> #include <com/sun/star/awt/PosSize.hpp> +/** === end UNO includes === **/ + +#include <tools/debug.hxx> #include <vcl/svapp.hxx> -#include "navtoolbar.hxx" -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif //-------------------------------------------------------------------------- extern "C" void SAL_CALL createRegistryInfo_ONavigationBarControl() @@ -200,6 +204,8 @@ namespace frm peerCreated(); mbCreatingPeer = sal_False; + + OControl::initFormControlPeer( getPeer() ); } } diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index 52ffd98b5efd..37b9faf8a5f4 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -334,6 +334,9 @@ namespace frm // the image of the item ::std::auto_ptr< SfxImageManager > pImageManager( new SfxImageManager( NULL ) ); pImageManager->SetImagesForceSize( *m_pToolbar, FALSE, m_eImageSize == eLarge ); + + // parts of our layout is dependent on the size of our icons + Resize(); } //--------------------------------------------------------------------- @@ -443,6 +446,15 @@ namespace frm case STATE_CHANGE_CONTROLFOREGROUND: forEachItemWindow( &NavigationToolBar::setItemControlForeground, NULL ); break; + + case STATE_CHANGE_MIRRORING: + { + BOOL bIsRTLEnabled( IsRTLEnabled() ); + m_pToolbar->EnableRTL( bIsRTLEnabled ); + forEachItemWindow( &NavigationToolBar::enableItemRTL, &bIsRTLEnabled ); + Resize(); + } + break; } } @@ -453,8 +465,8 @@ namespace frm sal_Int32 nToolbarHeight = m_pToolbar->CalcWindowSizePixel().Height(); sal_Int32 nMyHeight = GetOutputSizePixel().Height(); - m_pToolbar->SetPosPixel( Point( 0, ( nMyHeight - nToolbarHeight ) / 2 ) ); - m_pToolbar->SetSizePixel( Size( GetSizePixel().Width(), nToolbarHeight ) ); + m_pToolbar->SetPosSizePixel( Point( 0, ( nMyHeight - nToolbarHeight ) / 2 ), + Size( GetSizePixel().Width(), nToolbarHeight ) ); Window::Resize(); } @@ -587,6 +599,12 @@ namespace frm m_pToolbar->SetItemWindow( _nItemId, _pItemWindow ); } + //--------------------------------------------------------------------- + void NavigationToolBar::enableItemRTL( USHORT /*_nItemId*/, Window* _pItemWindow, const void* _pIsRTLEnabled ) const + { + _pItemWindow->EnableRTL( *static_cast< const BOOL* >( _pIsRTLEnabled ) ); + } + //===================================================================== //= RecordPositionInput //===================================================================== diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx index 46d9dd25587b..b19c57431706 100644 --- a/forms/source/solar/inc/navtoolbar.hxx +++ b/forms/source/solar/inc/navtoolbar.hxx @@ -148,6 +148,7 @@ namespace frm void setItemControlFont( USHORT /* _nItemId */, Window* _pItemWindow, const void* /* _pParam */ ) const; void setItemControlForeground( USHORT /* _nItemId */, Window* _pItemWindow, const void* /* _pParam */ ) const; void adjustItemWindowWidth( USHORT _nItemId, Window* _pItemWindow, const void* /* _pParam */ ) const; + void enableItemRTL( USHORT /*_nItemId*/, Window* _pItemWindow, const void* _pIsRTLEnabled ) const; }; //===================================================================== |