Kaydet (Commit) dbffeb3f authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

INTEGRATION: CWS apps61beta2 (1.96.2.1.30); FILE MERGED

2003/04/15 13:30:42 bm 1.96.2.1.30.2: RESYNC: (1.96.2.1-1.98); FILE MERGED
2003/04/10 18:13:58 cl 1.96.2.1.30.1: #108534# set paragraph depth before setting hard attributes
üst 7faef091
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: txtimp.cxx,v $ * $RCSfile: txtimp.cxx,v $
* *
* $Revision: 1.98 $ * $Revision: 1.99 $
* *
* last change: $Author: rt $ $Date: 2003-04-08 15:30:44 $ * last change: $Author: hr $ $Date: 2003-04-28 16:08:33 $
* *
* 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
...@@ -1003,71 +1003,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( ...@@ -1003,71 +1003,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
sStyleName = OUString(); sStyleName = OUString();
} }
// hard paragraph properties
if( pStyle )
{
pStyle->FillPropertySet( xPropSet );
if( bPara && pStyle->HasMasterPageName() &&
xPropSetInfo->hasPropertyByName( sPageDescName ) )
{
const OUString& rMasterPageName = pStyle->GetMasterPageName();
if( !rMasterPageName.getLength() ||
(xPageStyles.is() &&
xPageStyles->hasByName( rMasterPageName )) )
{
Any aAny;
aAny <<= rMasterPageName;
xPropSet->setPropertyValue( sPageDescName, aAny );
}
}
if( bPara && pStyle->GetDropCapStyleName().getLength() &&
xTextStyles.is() &&
xTextStyles->hasByName( pStyle->GetDropCapStyleName() ) &&
xPropSetInfo->hasPropertyByName( pStyle->sDropCapCharStyleName ) )
{
Any aAny;
aAny <<= pStyle->GetDropCapStyleName();
xPropSet->setPropertyValue( pStyle->sDropCapCharStyleName, aAny );
}
// combined characters special treatment
if (!bPara && pStyle->HasCombinedCharactersLetter())
{
// insert combined characters text field
if( xServiceFactory.is() )
{
Reference<XInterface> xIfc =
xServiceFactory->createInstance(sServiceCombinedCharacters);
if( xIfc.is() )
{
// fix cursor if larger than possible for
// combined characters field
if (rCursor->getString().getLength() >
MAX_COMBINED_CHARACTERS)
{
rCursor->gotoRange(rCursor->getStart(), sal_False);
rCursor->goRight(MAX_COMBINED_CHARACTERS, sal_True);
}
// set field value (the combined character string)
Reference<XPropertySet> xTmp( xIfc, UNO_QUERY );
Any aAny;
aAny <<= rCursor->getString();
xTmp->setPropertyValue(sContent, aAny);
// insert the field over it's original text
Reference<XTextRange> xRange(rCursor, UNO_QUERY);
Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
if (xText.is() && xRange.is())
{
xText->insertTextContent( xRange, xTextContent,
sal_True );
}
}
}
}
}
if( bPara && xPropSetInfo->hasPropertyByName( sNumberingRules ) ) if( bPara && xPropSetInfo->hasPropertyByName( sNumberingRules ) )
{ {
// Set numbering rules // Set numbering rules
...@@ -1186,6 +1121,71 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( ...@@ -1186,6 +1121,71 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
} }
} }
// hard paragraph properties
if( pStyle )
{
pStyle->FillPropertySet( xPropSet );
if( bPara && pStyle->HasMasterPageName() &&
xPropSetInfo->hasPropertyByName( sPageDescName ) )
{
const OUString& rMasterPageName = pStyle->GetMasterPageName();
if( !rMasterPageName.getLength() ||
(xPageStyles.is() &&
xPageStyles->hasByName( rMasterPageName )) )
{
Any aAny;
aAny <<= rMasterPageName;
xPropSet->setPropertyValue( sPageDescName, aAny );
}
}
if( bPara && pStyle->GetDropCapStyleName().getLength() &&
xTextStyles.is() &&
xTextStyles->hasByName( pStyle->GetDropCapStyleName() ) &&
xPropSetInfo->hasPropertyByName( pStyle->sDropCapCharStyleName ) )
{
Any aAny;
aAny <<= pStyle->GetDropCapStyleName();
xPropSet->setPropertyValue( pStyle->sDropCapCharStyleName, aAny );
}
// combined characters special treatment
if (!bPara && pStyle->HasCombinedCharactersLetter())
{
// insert combined characters text field
if( xServiceFactory.is() )
{
Reference<XInterface> xIfc =
xServiceFactory->createInstance(sServiceCombinedCharacters);
if( xIfc.is() )
{
// fix cursor if larger than possible for
// combined characters field
if (rCursor->getString().getLength() >
MAX_COMBINED_CHARACTERS)
{
rCursor->gotoRange(rCursor->getStart(), sal_False);
rCursor->goRight(MAX_COMBINED_CHARACTERS, sal_True);
}
// set field value (the combined character string)
Reference<XPropertySet> xTmp( xIfc, UNO_QUERY );
Any aAny;
aAny <<= rCursor->getString();
xTmp->setPropertyValue(sContent, aAny);
// insert the field over it's original text
Reference<XTextRange> xRange(rCursor, UNO_QUERY);
Reference<XTextContent> xTextContent(xTmp, UNO_QUERY);
if (xText.is() && xRange.is())
{
xText->insertTextContent( xRange, xTextContent,
sal_True );
}
}
}
}
}
return sStyleName; return sStyleName;
} }
......
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