summaryrefslogtreecommitdiff
path: root/starmath/source/unomodel.cxx
diff options
context:
space:
mode:
authorThomas Lange <tl@openoffice.org>2002-11-20 07:54:41 +0000
committerThomas Lange <tl@openoffice.org>2002-11-20 07:54:41 +0000
commit20d04d25c10bceb5b35c22af958858dd5d3c2b04 (patch)
tree27ce401333dce273405485d28053826bfe50ad7c /starmath/source/unomodel.cxx
parent154c5baef338c9c2a6144fa9175c0b89078edf66 (diff)
#100748# resizing problem when activating/reloading Writer documents with formulas fixed
Diffstat (limited to 'starmath/source/unomodel.cxx')
-rw-r--r--starmath/source/unomodel.cxx39
1 files changed, 8 insertions, 31 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 6c47d894a7e7..f61f0ee88b16 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unomodel.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: tl $ $Date: 2002-10-02 10:58:02 $
+ * last change: $Author: tl $ $Date: 2002-11-20 08:54:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -463,38 +463,15 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
String sFontName = aText;
if(!sFontName.Len())
throw IllegalArgumentException();
+
if(aFormat.GetFont((*ppEntries)->mnMemberId).GetName() != sFontName)
{
- OutputDevice *pDev = pDocSh->GetPrinter();
- if (!pDev || pDev->GetDevFontCount() == 0)
- pDev = (OutputDevice *) GetpApp()->GetDefaultDevice();
-
- FontList aFontList(pDev);
+ const SmFace rOld = aFormat.GetFont((*ppEntries)->mnMemberId);
- sal_uInt16 nCount = aFontList.GetFontNameCount();
- sal_Bool bSet = sal_False;
- for (sal_uInt16 i = 0; i < nCount; i++)
- {
- const FontInfo& rInfo = aFontList.GetFontName( i );
- if(rInfo.GetName() == sFontName)
- {
- SmFace aSet(rInfo);
- const SmFace rOld = aFormat.GetFont((*ppEntries)->mnMemberId);
- aSet.SetBorderWidth(rOld.GetBorderWidth());
- aSet.SetSize(rOld.GetSize());
- aSet.SetAlign(ALIGN_BASELINE);
- aFormat.SetFont((*ppEntries)->mnMemberId, aSet);
- bSet = sal_True;
- break;
- }
- }
- if(!bSet)
- {
- SmFace aSet(sFontName, aFormat.GetBaseSize());
- aSet.SetAlign(ALIGN_BASELINE);
- aFormat.SetFont((*ppEntries)->mnMemberId, aSet);
- //throw IllegalArgumentException();
- }
+ SmFace aSet( sFontName, rOld.GetSize() );
+ aSet.SetBorderWidth( rOld.GetBorderWidth() );
+ aSet.SetAlign( ALIGN_BASELINE );
+ aFormat.SetFont( (*ppEntries)->mnMemberId, aSet );
}
}
break;