summaryrefslogtreecommitdiffstats
path: root/svx/source/dialog/dlgutil.cxx
diff options
context:
space:
mode:
authorPeter Burow <pb@openoffice.org>2000-10-09 10:36:50 +0000
committerPeter Burow <pb@openoffice.org>2000-10-09 10:36:50 +0000
commit583b9c8d9befc05eb042ab4e65c5128685b4f9f0 (patch)
treeb8b97992b9a5eea7bf7c454085be4858381932ed /svx/source/dialog/dlgutil.cxx
parentmust change for comphelper (diff)
downloadcore-583b9c8d9befc05eb042ab4e65c5128685b4f9f0.tar.gz
core-583b9c8d9befc05eb042ab4e65c5128685b4f9f0.zip
chg: GetModuleFieldUnit() added
Diffstat (limited to 'svx/source/dialog/dlgutil.cxx')
-rw-r--r--svx/source/dialog/dlgutil.cxx36
1 files changed, 31 insertions, 5 deletions
diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx
index 1fdb5ead1008..9271106ec583 100644
--- a/svx/source/dialog/dlgutil.cxx
+++ b/svx/source/dialog/dlgutil.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlgutil.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:01:08 $
+ * last change: $Author: pb $ $Date: 2000-10-09 11:36:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -42,13 +42,13 @@
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
@@ -74,6 +74,9 @@
#include <unolingu.hxx>
#endif
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/objsh.hxx>
+
#pragma hdrstop
#include "dialogs.hrc"
@@ -207,6 +210,29 @@ void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll )
// -----------------------------------------------------------------------
+FieldUnit GetModuleFieldUnit()
+{
+ FieldUnit eUnit = FUNIT_INCH;
+ SfxViewFrame* pFrame = SfxViewFrame::Current();
+ SfxObjectShell* pSh = NULL;
+ if ( pFrame )
+ pSh = pFrame->GetObjectShell();
+ SfxModule* pModule = pSh ? pSh->GetModule() : NULL;
+ if ( pModule )
+ {
+ const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
+ if ( pItem )
+ eUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+ }
+ else
+ {
+ DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" );
+ }
+ return eUnit;
+}
+
+// -----------------------------------------------------------------------
+
void SetMetricValue( MetricField& rField, long nCoreValue, SfxMapUnit eUnit )
{
long nVal = OutputDevice::LogicToLogic( nCoreValue,