Kaydet (Commit) 34e69d42 authored tarafından Kurt Zenker's avatar Kurt Zenker

INTEGRATION: CWS swautowidth (1.13.82); FILE MERGED

2004/04/07 16:40:16 dvo 1.13.82.1: #i27203# load/save fo:min-width
üst 48e88205
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: txtimppr.cxx,v $ * $RCSfile: txtimppr.cxx,v $
* *
* $Revision: 1.13 $ * $Revision: 1.14 $
* *
* last change: $Author: rt $ $Date: 2003-12-01 16:24:58 $ * last change: $Author: kz $ $Date: 2004-05-18 15:05:39 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -194,6 +194,7 @@ XMLTextImportPropertyMapper::XMLTextImportPropertyMapper( ...@@ -194,6 +194,7 @@ XMLTextImportPropertyMapper::XMLTextImportPropertyMapper(
XMLFontStylesContext *pFontDecls ) : XMLFontStylesContext *pFontDecls ) :
SvXMLImportPropertyMapper( rMapper, rImport ), SvXMLImportPropertyMapper( rMapper, rImport ),
nSizeTypeIndex( -2 ), nSizeTypeIndex( -2 ),
nWidthTypeIndex( -2 ),
xFontDecls( pFontDecls ) xFontDecls( pFontDecls )
{ {
} }
...@@ -318,6 +319,8 @@ void XMLTextImportPropertyMapper::finished( ...@@ -318,6 +319,8 @@ void XMLTextImportPropertyMapper::finished(
{ {
sal_Bool bHasAnyHeight = sal_False; sal_Bool bHasAnyHeight = sal_False;
sal_Bool bHasAnyMinHeight = sal_False; sal_Bool bHasAnyMinHeight = sal_False;
sal_Bool bHasAnyWidth = sal_False;
sal_Bool bHasAnyMinWidth = sal_False;
XMLPropertyState* pFontFamilyName = 0; XMLPropertyState* pFontFamilyName = 0;
XMLPropertyState* pFontStyleName = 0; XMLPropertyState* pFontStyleName = 0;
...@@ -414,6 +417,13 @@ void XMLTextImportPropertyMapper::finished( ...@@ -414,6 +417,13 @@ void XMLTextImportPropertyMapper::finished(
case CTF_FRAMEHEIGHT_REL: case CTF_FRAMEHEIGHT_REL:
// case CTF_SYNCHEIGHT: // case CTF_SYNCHEIGHT:
bHasAnyHeight = sal_True; break; bHasAnyHeight = sal_True; break;
case CTF_FRAMEWIDTH_MIN_ABS:
case CTF_FRAMEWIDTH_MIN_REL:
bHasAnyMinWidth = sal_True;
// no break here!
case CTF_FRAMEWIDTH_ABS:
case CTF_FRAMEWIDTH_REL:
bHasAnyWidth = sal_True; break;
case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break; case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break;
case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = property; break; case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = property; break;
...@@ -723,6 +733,34 @@ void XMLTextImportPropertyMapper::finished( ...@@ -723,6 +733,34 @@ void XMLTextImportPropertyMapper::finished(
} }
} }
if( bHasAnyWidth )
{
if( nWidthTypeIndex == -2 )
{
const_cast < XMLTextImportPropertyMapper * > ( this )
->nWidthTypeIndex = -1;
sal_Int32 nCount = getPropertySetMapper()->GetEntryCount();
for( sal_Int32 i=0; i < nCount; i++ )
{
if( CTF_FRAMEWIDTH_TYPE == getPropertySetMapper()
->GetEntryContextId( i ) )
{
const_cast < XMLTextImportPropertyMapper * > ( this )
->nWidthTypeIndex = i;
break;
}
}
}
if( nWidthTypeIndex != -1 )
{
XMLPropertyState aSizeTypeState( nWidthTypeIndex );
aSizeTypeState.maValue <<= (sal_Int16)( bHasAnyMinWidth
? SizeType::MIN
: SizeType::FIX);
rProperties.push_back( aSizeTypeState );
}
}
// DO NOT USE ITERATORS/POINTERS INTO THE rProperties-VECTOR AFTER // DO NOT USE ITERATORS/POINTERS INTO THE rProperties-VECTOR AFTER
// THIS LINE. All iterators into the rProperties-vector, especially all // THIS LINE. All iterators into the rProperties-vector, especially all
// pXXX-type variables set in the first switch statement of this method, // pXXX-type variables set in the first switch statement of this method,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment