diff options
author | Sven Jacobi <sj@openoffice.org> | 2001-03-08 10:05:42 +0000 |
---|---|---|
committer | Sven Jacobi <sj@openoffice.org> | 2001-03-08 10:05:42 +0000 |
commit | 79afdcc0bda11d5a5c7ec9773e4a1e2b1abf8fec (patch) | |
tree | 2d7e786dc60043217f0db0fdd17dfe6298280c23 /goodies/source | |
parent | 531765937be141ad65e883889940066907a1374e (diff) |
api changes, GraphicFilter now using Configuration Management
Diffstat (limited to 'goodies/source')
-rw-r--r-- | goodies/source/filter.vcl/epict/dlgepct.cxx | 62 | ||||
-rw-r--r-- | goodies/source/filter.vcl/epict/dlgepct.hxx | 9 | ||||
-rw-r--r-- | goodies/source/filter.vcl/epict/epict.cxx | 14 | ||||
-rw-r--r-- | goodies/source/filter.vcl/epict/epictstr.src | 15 | ||||
-rw-r--r-- | goodies/source/filter.vcl/epict/makefile.mk | 6 | ||||
-rw-r--r-- | goodies/source/filter.vcl/epict/strings.hrc | 7 |
6 files changed, 50 insertions, 63 deletions
diff --git a/goodies/source/filter.vcl/epict/dlgepct.cxx b/goodies/source/filter.vcl/epict/dlgepct.cxx index 8b89d8871d3e..7582c76d7afb 100644 --- a/goodies/source/filter.vcl/epict/dlgepct.cxx +++ b/goodies/source/filter.vcl/epict/dlgepct.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgepct.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:30:12 $ + * last change: $Author: sj $ $Date: 2001-03-08 11:04:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,7 +62,10 @@ #pragma hdrstop #include <vcl/msgbox.hxx> -#include <vcl/config.hxx> +#include <svtools/FilterConfigItem.hxx> +#ifndef _COM_SUN_STAR_AWT_SIZE_HPP_ +#include <com/sun/star/awt/Size.hpp> +#endif #include "dlgepct.hxx" #include "dlgepct.hrc" #include "strings.hrc" @@ -86,37 +89,28 @@ DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) : aFtSizeY ( this, ResId( FT_SIZEY ) ), aMtfSizeY ( this, ResId( MTF_SIZEY ) ), aGrpSize ( this, ResId( GRP_SIZE ) ), - pConfig ( rPara.pCfg ), pMgr ( rPara.pResMgr ) { FreeResource(); + String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PCT" ) ); + pConfigItem = new FilterConfigItem( aFilterConfigPath ); + aBtnOK.SetClickHdl( LINK( this, DlgExportEPCT, OK ) ); aRbOriginal.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbOriginal ) ); aRbSize.SetClickHdl( LINK( this, DlgExportEPCT, ClickRbSize ) ); // Config-Parameter lesen - String aMStr( ResId( KEY_MODE, pMgr ) ); - String aSXStr( ResId( KEY_SIZEX, pMgr ) ); - String aSYStr( ResId( KEY_SIZEY, pMgr ) ); - - sal_Int32 nStrMode( pConfig->ReadKey( ByteString( aMStr, RTL_TEXTENCODING_UTF8 ) ).ToInt32() ); - ByteString aStrSizeX( pConfig->ReadKey( ByteString( aSXStr, RTL_TEXTENCODING_UTF8 ) ) ); - ByteString aStrSizeY( pConfig->ReadKey( ByteString( aSYStr, RTL_TEXTENCODING_UTF8 ) ) ); + sal_Int32 nStrMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, pMgr ) ), 0 ); + ::com::sun::star::awt::Size aDefault( 10000, 10000 ); + ::com::sun::star::awt::Size aSize; + aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, pMgr ) ), aDefault ); aMtfSizeX.SetDefaultUnit( FUNIT_MM ); aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - - if ( !aStrSizeX.Len() ) - aMtfSizeX.SetValue( 10000 ); - else - aMtfSizeX.SetValue( aStrSizeX.ToInt32() ); - - if ( !aStrSizeY.Len() ) - aMtfSizeY.SetValue( 10000 ); - else - aMtfSizeY.SetValue( aStrSizeY.ToInt32() ); + aMtfSizeX.SetValue( aSize.Width ); + aMtfSizeY.SetValue( aSize.Height ); switch ( rPara.eFieldUnit ) { @@ -140,7 +134,6 @@ DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) : } break; } - if ( nStrMode == 1 ) { aRbSize.Check( TRUE ); @@ -153,6 +146,11 @@ DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) : } } +DlgExportEPCT::~DlgExportEPCT() +{ + delete pConfigItem; +} + /************************************************************************* |* |* Speichert eingestellte Werte in ini-Datei @@ -162,22 +160,16 @@ DlgExportEPCT::DlgExportEPCT( FltCallDialogParameter& rPara ) : IMPL_LINK( DlgExportEPCT, OK, void *, EMPTYARG ) { // Config-Parameter schreiben - sal_Int32 nSizeX = (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ); - sal_Int32 nSizeY = (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ); - sal_Int32 nStrMode; + ::com::sun::star::awt::Size aSize( + (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM ), + (sal_Int32)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM ) ); + sal_Int32 nStrMode = 0; if ( aRbSize.IsChecked() ) - nStrMode = 1; - else - nStrMode = 0; - - String aMStr( ResId( KEY_MODE, pMgr ) ); - String aSXStr( ResId( KEY_SIZEX, pMgr ) ); - String aSYStr( ResId( KEY_SIZEY, pMgr ) ); - pConfig->WriteKey( ByteString( aMStr, RTL_TEXTENCODING_UTF8 ), ByteString::CreateFromInt32( nStrMode ) ); - pConfig->WriteKey( ByteString( aSXStr, RTL_TEXTENCODING_UTF8 ), ByteString::CreateFromInt32( nSizeX ) ); - pConfig->WriteKey( ByteString( aSYStr, RTL_TEXTENCODING_UTF8 ), ByteString::CreateFromInt32( nSizeY ) ); + nStrMode++; + pConfigItem->WriteInt32( String( ResId( KEY_MODE, pMgr ) ), nStrMode ); + pConfigItem->WriteSize( String( ResId( KEY_SIZE, pMgr ) ), aSize ); EndDialog( RET_OK ); return 0; diff --git a/goodies/source/filter.vcl/epict/dlgepct.hxx b/goodies/source/filter.vcl/epict/dlgepct.hxx index 79df32b3aab9..75e59504d818 100644 --- a/goodies/source/filter.vcl/epict/dlgepct.hxx +++ b/goodies/source/filter.vcl/epict/dlgepct.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgepct.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:30:12 $ + * last change: $Author: sj $ $Date: 2001-03-08 11:04:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,7 +76,7 @@ |* \************************************************************************/ -class Config; +class FilterConfigItem; class ResMgr; class DlgExportEPCT : public ModalDialog @@ -96,7 +96,7 @@ private: MetricField aMtfSizeY; GroupBox aGrpSize; - Config* pConfig; + FilterConfigItem* pConfigItem; ResMgr* pMgr; DECL_LINK( OK, void* p ); @@ -105,6 +105,7 @@ private: public: DlgExportEPCT( FltCallDialogParameter& rPara ); + ~DlgExportEPCT(); }; #endif // _DLGEPCT_HXX_ diff --git a/goodies/source/filter.vcl/epict/epict.cxx b/goodies/source/filter.vcl/epict/epict.cxx index 45c42a70835b..5d26bd869510 100644 --- a/goodies/source/filter.vcl/epict/epict.cxx +++ b/goodies/source/filter.vcl/epict/epict.cxx @@ -2,9 +2,9 @@ * * $RCSfile: epict.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: obo $ $Date: 2000-10-31 10:39:39 $ + * last change: $Author: sj $ $Date: 2001-03-08 11:04:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -782,8 +782,8 @@ void PictWriter::WriteOpcode_FontName(const Font & rFont) if (bDstFontNameValid==FALSE || nDstFontNameId!=nFontId || aDstFontName!=rFont.GetName()) { ByteString aByteString( rFont.GetName(), gsl_getSystemTextEncoding() ); - sal_Int32 nFontNameLen = aByteString.Len(); - if ( nFontNameLen > 0 ) + sal_uInt16 nFontNameLen = aByteString.Len(); + if ( nFontNameLen ) { nDataLen = 3 + nFontNameLen; *pPict << (USHORT)0x002c << nDataLen << nFontId; @@ -2224,11 +2224,11 @@ BOOL PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, P #ifdef WNT extern "C" BOOL _cdecl GraphicExport(SvStream & rStream, Graphic & rGraphic, PFilterCallback pCallback, void * pCallerData, - Config *, BOOL) + FilterConfigItem*, BOOL) #else extern "C" BOOL GraphicExport(SvStream & rStream, Graphic & rGraphic, PFilterCallback pCallback, void * pCallerData, - Config *, BOOL) + FilterConfigItem, BOOL) #endif { PictWriter aPictWriter; @@ -2277,7 +2277,7 @@ extern "C" BOOL SAL_CALL DoExportDialog( FltCallDialogParameter& rPara ) { BOOL bRet = FALSE; - if ( rPara.pWindow && rPara.pCfg ) + if ( rPara.pWindow ) { ByteString aResMgrName( "ept" ); ResMgr* pResMgr; diff --git a/goodies/source/filter.vcl/epict/epictstr.src b/goodies/source/filter.vcl/epict/epictstr.src index 9b4181bc7366..3e536118180a 100644 --- a/goodies/source/filter.vcl/epict/epictstr.src +++ b/goodies/source/filter.vcl/epict/epictstr.src @@ -2,9 +2,9 @@ * * $RCSfile: epictstr.src,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:30:12 $ + * last change: $Author: sj $ $Date: 2001-03-08 11:05:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,15 +63,10 @@ String KEY_MODE { - Text = "PCT-EXPORT-MODE"; + Text = "ExportMode"; }; -String KEY_SIZEX +String KEY_SIZE { - Text = "PCT-EXPORT-SIZEX"; -}; - -String KEY_SIZEY -{ - Text = "PCT-EXPORT-SIZEY"; + Text = "Size"; }; diff --git a/goodies/source/filter.vcl/epict/makefile.mk b/goodies/source/filter.vcl/epict/makefile.mk index 7afbc9e0223b..8193089fa0a5 100644 --- a/goodies/source/filter.vcl/epict/makefile.mk +++ b/goodies/source/filter.vcl/epict/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.1.1.1 $ +# $Revision: 1.2 $ # -# last change: $Author: hr $ $Date: 2000-09-18 16:30:12 $ +# last change: $Author: sj $ $Date: 2001-03-08 11:05:18 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -105,7 +105,7 @@ RESLIB1SRSFILES=\ SHL1TARGET= ept$(UPD)$(DLLPOSTFIX) SHL1IMPLIB= epict -SHL1STDLIBS= $(TOOLSLIB) $(SVLIB) $(SVTOOLLIB) $(CPPULIB) +SHL1STDLIBS= $(TOOLSLIB) $(SVLIB) $(SVTOOLLIB) $(CPPULIB) $(SALLIB) SHL1DEPN= $(LB)$/epict.lib SHL1LIBS= $(SLB)$/epict.lib # $(LB)$/rtftoken.lib diff --git a/goodies/source/filter.vcl/epict/strings.hrc b/goodies/source/filter.vcl/epict/strings.hrc index 89b93b729e0b..740bca11cfd0 100644 --- a/goodies/source/filter.vcl/epict/strings.hrc +++ b/goodies/source/filter.vcl/epict/strings.hrc @@ -2,9 +2,9 @@ * * $RCSfile: strings.hrc,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:30:12 $ + * last change: $Author: sj $ $Date: 2001-03-08 11:05:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,6 +59,5 @@ * ************************************************************************/ #define KEY_MODE 260 -#define KEY_SIZEX 262 -#define KEY_SIZEY 264 +#define KEY_SIZE 261 |