summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-03-15 09:44:53 +0000
committerOliver Specht <os@openoffice.org>2001-03-15 09:44:53 +0000
commit2c618395d244a329c41fb6cc64a8bb68cecfdae8 (patch)
tree1af7890379b13a8db35ec478ad0ec8e46f324e63 /sw/source/ui
parent5eb9f6cbd88c4bc2b6097b506267a4a5eeaaf097 (diff)
change: MetricFormatter::SetVaolue now virtual
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/frmdlg/column.cxx24
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx16
-rw-r--r--sw/source/ui/inc/prcntfld.hxx7
-rw-r--r--sw/source/ui/utlui/prcntfld.cxx29
4 files changed, 43 insertions, 33 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 66160fca40ba..d60c87cd90ce 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: column.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: os $ $Date: 2000-10-25 15:00:36 $
+ * last change: $Author: os $ $Date: 2001-03-15 10:44:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -952,7 +952,7 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
if(nActValue > nMaxGap)
{
nActValue = nMaxGap;
- aDistEd1.SetValue(aDistEd1.Normalize(nMaxGap), FUNIT_TWIP);
+ aDistEd1.SetPrcntValue(aDistEd1.Normalize(nMaxGap), FUNIT_TWIP);
}
pColMgr->SetGutterWidth((USHORT)nActValue);
for(USHORT i = 0; i < nCols; i++)
@@ -1137,13 +1137,13 @@ void SwColumnPage::Update()
aBalanceColsCB.Enable(nCols > 1);
if(nCols >= 2)
{
- aEd1.SetValue(aEd1.Normalize(nColWidth[nFirstVis]), FUNIT_TWIP);
- aDistEd1.SetValue(aDistEd1.Normalize(nColDist[nFirstVis]), FUNIT_TWIP);
- aEd2.SetValue(aEd2.Normalize(nColWidth[nFirstVis + 1]), FUNIT_TWIP);
+ aEd1.SetPrcntValue(aEd1.Normalize(nColWidth[nFirstVis]), FUNIT_TWIP);
+ aDistEd1.SetPrcntValue(aDistEd1.Normalize(nColDist[nFirstVis]), FUNIT_TWIP);
+ aEd2.SetPrcntValue(aEd2.Normalize(nColWidth[nFirstVis + 1]), FUNIT_TWIP);
if(nCols >= 3)
{
- aDistEd2.SetValue(aDistEd2.Normalize(nColDist[nFirstVis + 1]), FUNIT_TWIP);
- aEd3.SetValue(aEd3.Normalize(nColWidth[nFirstVis + 2]), FUNIT_TWIP);
+ aDistEd2.SetPrcntValue(aDistEd2.Normalize(nColDist[nFirstVis + 1]), FUNIT_TWIP);
+ aEd3.SetPrcntValue(aEd3.Normalize(nColWidth[nFirstVis + 2]), FUNIT_TWIP);
}
else
{
@@ -1282,7 +1282,7 @@ IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS )
{
aCLNrEdt.SetValue( nItem );
aAutoWidthBox.Check();
- aDistEd1.SetValue(0);
+ aDistEd1.SetPrcntValue(0);
ColModify(0);
}
else
@@ -1290,18 +1290,18 @@ IMPL_LINK( SwColumnPage, SetDefaultsHdl, ValueSet *, pVS )
bLockUpdate = TRUE;
aCLNrEdt.SetValue( 2 );
aAutoWidthBox.Check(FALSE);
- aDistEd1.SetValue(0);
+ aDistEd1.SetPrcntValue(0);
ColModify(0);
// jetzt noch das Breitenverhaeltnisse auf 2 : 1 bzw. 1 : 2 stellen
USHORT nSmall = pColMgr->GetActualSize() / 3;
if(nItem == 4)
{
- aEd2.SetValue(aEd2.Normalize(long(nSmall)), FUNIT_TWIP);
+ aEd2.SetPrcntValue(aEd2.Normalize(long(nSmall)), FUNIT_TWIP);
pModifiedField = &aEd2;
}
else
{
- aEd1.SetValue(aEd1.Normalize(long(nSmall)), FUNIT_TWIP);
+ aEd1.SetPrcntValue(aEd1.Normalize(long(nSmall)), FUNIT_TWIP);
pModifiedField = &aEd1;
}
bLockUpdate = FALSE;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index c89302cb0f87..10c5ae15480f 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmpage.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: os $ $Date: 2001-02-09 07:49:14 $
+ * last change: $Author: os $ $Date: 2001-03-15 10:44:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1833,7 +1833,7 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit )
aHeightED.GetRefValue() * ( aHeightED.GetOldDigits() == 1 ? 10 : 100):
aHeightED.GetMax(FUNIT_TWIP);
if(nMaxHeight >= nTmp)
- aHeightED.SetValue(nTmp, FUNIT_TWIP);
+ aHeightED.SetPrcntValue(nTmp, FUNIT_TWIP);
else
{
//cut selected width
@@ -1855,7 +1855,7 @@ IMPL_LINK( SwFrmPage, ModifyHdl, Edit *, pEdit )
aWidthED.GetRefValue() * (aWidthED.GetOldDigits()== 1 ? 10 : 100):
aWidthED.GetMax(FUNIT_TWIP);
if(nMaxWidth >= nTmp)
- aWidthED.SetValue(nTmp, FUNIT_TWIP);
+ aWidthED.SetPrcntValue(nTmp, FUNIT_TWIP);
else
{
//cut selected height
@@ -1938,7 +1938,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, BOOL bReset)
aWidthED.SetUserValue(nWidth, FUNIT_TWIP);
}
else
- aWidthED.SetValue(nWidth, FUNIT_TWIP);
+ aWidthED.SetPrcntValue(nWidth, FUNIT_TWIP);
}
if (nHeight != aHeightED.GetValue(FUNIT_TWIP))
@@ -1950,7 +1950,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, BOOL bReset)
aHeightED.SetUserValue(nHeight, FUNIT_TWIP);
}
else
- aHeightED.SetValue(nHeight, FUNIT_TWIP);
+ aHeightED.SetPrcntValue(nHeight, FUNIT_TWIP);
}
if (nDlgType != DLG_FRM_GRF && nDlgType != DLG_FRM_OLE)
@@ -2040,14 +2040,14 @@ void SwFrmPage::Init(const SfxItemSet& rSet, BOOL bReset)
{
aRelWidthCB.Check(TRUE);
RelSizeClickHdl(&aRelWidthCB);
- aWidthED.SetValue(rSize.GetWidthPercent(), FUNIT_CUSTOM);
+ aWidthED.SetPrcntValue(rSize.GetWidthPercent(), FUNIT_CUSTOM);
}
if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 0xff &&
!aRelHeightCB.IsChecked())
{
aRelHeightCB.Check(TRUE);
RelSizeClickHdl(&aRelHeightCB);
- aHeightED.SetValue(rSize.GetHeightPercent(), FUNIT_CUSTOM);
+ aHeightED.SetPrcntValue(rSize.GetHeightPercent(), FUNIT_CUSTOM);
}
aRelWidthCB.SaveValue();
aRelHeightCB.SaveValue();
diff --git a/sw/source/ui/inc/prcntfld.hxx b/sw/source/ui/inc/prcntfld.hxx
index 47ee3cf3a724..0bc67329ead9 100644
--- a/sw/source/ui/inc/prcntfld.hxx
+++ b/sw/source/ui/inc/prcntfld.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prcntfld.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:41 $
+ * last change: $Author: os $ $Date: 2001-03-15 10:44:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,10 +75,11 @@ class PercentField : public MetricField
long ImpPower10(USHORT n);
+ virtual void SetValue(long nNewValue, FieldUnit eInUnit = FUNIT_NONE);
public:
PercentField( Window* pWin, const ResId& rResId );
- void SetValue(long nNewValue, FieldUnit eInUnit = FUNIT_NONE);
+ void SetPrcntValue(long nNewValue, FieldUnit eInUnit = FUNIT_NONE);
void SetUserValue(long nNewValue, FieldUnit eInUnit = FUNIT_NONE);
void SetBaseValue(long nNewValue, FieldUnit eInUnit = FUNIT_NONE);
long GetValue(FieldUnit eOutUnit = FUNIT_NONE);
diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx
index 9805bd348915..cc8067deb2e6 100644
--- a/sw/source/ui/utlui/prcntfld.cxx
+++ b/sw/source/ui/utlui/prcntfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prcntfld.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:50 $
+ * last change: $Author: os $ $Date: 2001-03-15 10:44:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,7 +98,7 @@ void PercentField::SetRefValue(long nValue)
nRefValue = nValue;
if (GetUnit() == FUNIT_CUSTOM)
- SetValue(nRealValue, eOldUnit);
+ SetPrcntValue(nRealValue, eOldUnit);
}
/*--------------------------------------------------------------------
@@ -148,12 +148,12 @@ void PercentField::ShowPercent(BOOL bPercent)
{
nAktWidth = ConvertValue(nOldValue, 0, nOldDigits, eOldUnit, FUNIT_TWIP);
nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10;
- MetricField::SetValue(nPercent);
+ MetricFormatter::SetValue(nPercent);
nLastPercent = nPercent;
nLastValue = nOldValue;
}
else
- MetricField::SetValue(nLastPercent);
+ MetricFormatter::SetValue(nLastPercent);
// SetValue(100, FUNIT_CUSTOM);
}
else
@@ -175,23 +175,29 @@ void PercentField::ShowPercent(BOOL bPercent)
if (nOldPercent != nLastPercent)
{
- SetValue(nOldValue, eOldUnit);
+ SetPrcntValue(nOldValue, eOldUnit);
nLastPercent = nOldPercent;
nLastValue = nOldValue;
}
else
- SetValue(nLastValue, eOldUnit);
+ SetPrcntValue(nLastValue, eOldUnit);
}
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
-
void PercentField::SetValue(long nNewValue, FieldUnit eInUnit)
{
+ MetricFormatter::SetValue(nNewValue, eInUnit);
+}
+/*--------------------------------------------------------------------
+ Beschreibung:
+ --------------------------------------------------------------------*/
+void PercentField::SetPrcntValue(long nNewValue, FieldUnit eInUnit)
+{
if (GetUnit() != FUNIT_CUSTOM || eInUnit == FUNIT_CUSTOM)
- MetricField::SetValue(Convert(nNewValue, eInUnit, GetUnit()));
+ MetricFormatter::SetValue(Convert(nNewValue, eInUnit, GetUnit()));
else
{
@@ -207,7 +213,7 @@ void PercentField::SetValue(long nNewValue, FieldUnit eInUnit)
nAktWidth = ConvertValue(nValue, 0, nOldDigits, eOldUnit, FUNIT_TWIP);
}
nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10;
- MetricField::SetValue(nPercent);
+ MetricFormatter::SetValue(nPercent);
}
}
@@ -409,6 +415,9 @@ long PercentField::Convert(long nValue, FieldUnit eInUnit, FieldUnit eOutUnit)
Source Code Control System - History
$Log: not supported by cvs2svn $
+ Revision 1.1.1.1 2000/09/18 17:14:50 hr
+ initial import
+
Revision 1.21 2000/09/18 16:06:19 willem.vandorp
OpenOffice header added.