summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Jacobi <sj@openoffice.org>2001-04-26 12:14:19 +0000
committerSven Jacobi <sj@openoffice.org>2001-04-26 12:14:19 +0000
commit3cb15690a812f5ba4c06d2f5f12204350447220e (patch)
tree3ac5b1bf05d8af170e7a8dcb997ad61723703068
parent17fc34083a4e859e98f26708a01955716594cb2a (diff)
added methods which allow to read and write configuration Strings
-rw-r--r--svtools/source/filter.vcl/filter/FilterConfigItem.cxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
index 63df68875010..bf5bc2a4c3ec 100644
--- a/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter.vcl/filter/FilterConfigItem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FilterConfigItem.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: sj $ $Date: 2001-04-25 16:55:41 $
+ * last change: $Author: sj $ $Date: 2001-04-26 13:14:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -319,6 +319,15 @@ Size FilterConfigItem::ReadSize( const OUString& rKey, const Size& rDefault )
return aRetValue;
}
+OUString FilterConfigItem::ReadString( const OUString& rKey, const OUString& rDefault )
+{
+ Any aAny;
+ OUString aRetValue( rDefault );
+ if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
+ aAny >>= aRetValue;
+ return aRetValue;
+}
+
void FilterConfigItem::WriteBool( const OUString& rKey, sal_Bool bNewValue )
{
if ( xPropSet.is() )
@@ -414,4 +423,33 @@ void FilterConfigItem::WriteSize( const OUString& rKey, const Size& rNewValue )
}
}
+void FilterConfigItem::WriteString( const OUString& rKey, const OUString& rNewValue )
+{
+ if ( xPropSet.is() )
+ {
+ Any aAny;
+
+ if ( ImplGetPropertyValue( aAny, xPropSet, rKey, sal_True ) )
+ {
+ OUString aOldValue;
+ if ( aAny >>= aOldValue )
+ {
+ if ( aOldValue != rNewValue )
+ {
+ aAny <<= rNewValue;
+ try
+ {
+ xPropSet->setPropertyValue( rKey, aAny );
+ bModified = sal_True;
+ }
+ catch ( ::com::sun::star::uno::Exception& )
+ {
+ DBG_ERROR( "FilterConfigItem::WriteInt32 - could not set PropertyValue" );
+ }
+ }
+ }
+ }
+ }
+}
+
// ------------------------------------------------------------------------