Kaydet (Commit) ac436499 authored tarafından Noel Power's avatar Noel Power

remove SwXODFCheckboxField and fix a stray edit

üst eeeaf6c3
...@@ -149,7 +149,7 @@ public: ...@@ -149,7 +149,7 @@ public:
::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL GetPropertyValue( virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
const ::rtl::OUString& rPropertyName) const ::rtl::OUString& rPropertyName)
throw (::com::sun::star::beans::UnknownPropertyException, throw (::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::lang::WrappedTargetException,
...@@ -236,8 +236,8 @@ class SwXFieldmark ...@@ -236,8 +236,8 @@ class SwXFieldmark
: public SwXFieldmark_Base : public SwXFieldmark_Base
{ {
protected: private:
::sw::mark::ICheckboxFieldmark* getCheckboxFieldmark();
bool isReplacementObject; bool isReplacementObject;
public: public:
...@@ -259,17 +259,6 @@ public: ...@@ -259,17 +259,6 @@ public:
throw (::com::sun::star::uno::RuntimeException); throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getParameters( ) virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getParameters( )
throw (::com::sun::star::uno::RuntimeException); throw (::com::sun::star::uno::RuntimeException);
};
class SwXODFCheckboxField : public SwXFieldmark
{
private:
::sw::mark::ICheckboxFieldmark* getCheckboxFieldmark();
public:
SwXODFCheckboxField( ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0) : SwXFieldmark(true,
pBkm, pDoc) {}
virtual void SAL_CALL setPropertyValue( virtual void SAL_CALL setPropertyValue(
const ::rtl::OUString& rPropertyName, const ::rtl::OUString& rPropertyName,
const ::com::sun::star::uno::Any& rValue) const ::com::sun::star::uno::Any& rValue)
...@@ -284,7 +273,13 @@ public: ...@@ -284,7 +273,13 @@ public:
throw (::com::sun::star::beans::UnknownPropertyException, throw (::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException, ::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::RuntimeException);
};
class SwXODFCheckboxField : public SwXFieldmark
{
public:
SwXODFCheckboxField( ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0) : SwXFieldmark(true,
pBkm, pDoc) {}
}; };
#endif // SW_UNOBOOKMARK_HXX #endif // SW_UNOBOOKMARK_HXX
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <comcore.hrc> #include <comcore.hrc>
#include <undobj.hxx> #include <undobj.hxx>
#include <docsh.hxx> #include <docsh.hxx>
#include <xmloff/odffields.hxx>
using namespace ::sw::mark; using namespace ::sw::mark;
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -679,12 +679,13 @@ SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark & rMark) ...@@ -679,12 +679,13 @@ SwXFieldmark::CreateXFieldmark(SwDoc & rDoc, ::sw::mark::IMark & rMark)
} }
::sw::mark::ICheckboxFieldmark* ::sw::mark::ICheckboxFieldmark*
SwXODFCheckboxField::getCheckboxFieldmark() SwXFieldmark::getCheckboxFieldmark()
{ {
// evil #TODO #FIXME can we get rid of the dynamic_cast ::sw::mark::ICheckboxFieldmark* pCheckboxFm = NULL;
const ::sw::mark::ICheckboxFieldmark* pCheckboxFm = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()); if ( getFieldType() == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX) ) )
// even evil-er #TODO #FIXME casting away the constness // evil #TODO #FIXME casting away the const-ness
return ((::sw::mark::ICheckboxFieldmark*)(pCheckboxFm)); pCheckboxFm = (::sw::mark::ICheckboxFieldmark*)(reinterpret_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()));
return pCheckboxFm;
} }
...@@ -692,7 +693,7 @@ SwXODFCheckboxField::getCheckboxFieldmark() ...@@ -692,7 +693,7 @@ SwXODFCheckboxField::getCheckboxFieldmark()
// docx import filter thus not published via PropertySet info ) // docx import filter thus not published via PropertySet info )
void SAL_CALL void SAL_CALL
SwXODFCheckboxField::setPropertyValue(const OUString& PropertyName, SwXFieldmark::setPropertyValue(const OUString& PropertyName,
const uno::Any& rValue) const uno::Any& rValue)
throw (beans::UnknownPropertyException, beans::PropertyVetoException, throw (beans::UnknownPropertyException, beans::PropertyVetoException,
lang::IllegalArgumentException, lang::WrappedTargetException, lang::IllegalArgumentException, lang::WrappedTargetException,
...@@ -710,26 +711,26 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, ...@@ -710,26 +711,26 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
} }
else else
SwXFieldmark::setPropertyValue( PropertyName, rValue ); SwXFieldmark_Base::setPropertyValue( PropertyName, rValue );
} }
// support 'hidden' "Checked" property ( note: this property is just for convenience to support // support 'hidden' "Checked" property ( note: this property is just for convenience to support
// docx import filter thus not published via PropertySet info ) // docx import filter thus not published via PropertySet info )
uno::Any SAL_CALL SwXODFCheckboxField::getPropertyValue(const OUString& rPropertyName) uno::Any SAL_CALL SwXFieldmark::getPropertyValue(const OUString& rPropertyName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException, throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException) uno::RuntimeException)
{ {
SolarMutexGuard g; SolarMutexGuard g;
if ( PropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Checked") ) ) ) if ( rPropertyName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Checked") ) ) )
{ {
::sw::mark::ICheckboxFieldmark* pCheckboxFm = getCheckboxFieldmark(); ::sw::mark::ICheckboxFieldmark* pCheckboxFm = getCheckboxFieldmark();
if ( pCheckboxFm ) if ( pCheckboxFm )
return uno::makeAny( pCheckboxFm->GetChecked() ); return uno::makeAny( pCheckboxFm->IsChecked() );
else else
throw uno::RuntimeException(); throw uno::RuntimeException();
} }
return SwXFieldmark::getPropertyValue( PropertyName ); return SwXFieldmark_Base::getPropertyValue( rPropertyName );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -564,6 +564,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 ...@@ -564,6 +564,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
} }
break; break;
case SW_SERVICE_ODF_FORM_LISTBOX: case SW_SERVICE_ODF_FORM_LISTBOX:
case SW_SERVICE_ODF_FORM_CHECKBOX:
case SW_SERVICE_TYPE_FORMFIELDMARK : case SW_SERVICE_TYPE_FORMFIELDMARK :
{ {
SwXFieldmark* pFieldmark = new SwXFieldmark(true); SwXFieldmark* pFieldmark = new SwXFieldmark(true);
...@@ -838,12 +839,6 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 ...@@ -838,12 +839,6 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
case SW_SERVICE_FIELDTYPE_METAFIELD: case SW_SERVICE_FIELDTYPE_METAFIELD:
xRet = static_cast< ::cppu::OWeakObject* >(new SwXMetaField(pDoc)); xRet = static_cast< ::cppu::OWeakObject* >(new SwXMetaField(pDoc));
break; break;
case SW_SERVICE_ODF_FORM_CHECKBOX:
{
SwXFieldmark* pFormCheckbox = new SwXODFCheckboxField();
xRet = (cppu::OWeakObject*)pFormCheckbox;
}
break;
default: default:
throw uno::RuntimeException(); throw uno::RuntimeException();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment