summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlstyle.cxx
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2001-03-21 09:51:03 +0000
committerSascha Ballach <sab@openoffice.org>2001-03-21 09:51:03 +0000
commit652fc784bb4a3eddcda1737ad5ad7c4439bb9d3f (patch)
tree64195e875283eabec4c528074e78be3dcdd20612 /xmloff/source/style/xmlstyle.cxx
parent8af76adf860c3a93906cd8db499b96027c46464f (diff)
#85196#, only try to create style if families contain the familie
Diffstat (limited to 'xmloff/source/style/xmlstyle.cxx')
-rw-r--r--xmloff/source/style/xmlstyle.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx
index f67c0871f643..510801f405ae 100644
--- a/xmloff/source/style/xmlstyle.cxx
+++ b/xmloff/source/style/xmlstyle.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyle.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: sab $ $Date: 2001-02-28 08:24:41 $
+ * last change: $Author: sab $ $Date: 2001-03-21 10:51:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -863,18 +863,21 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
Reference< XStyleFamiliesSupplier > xFamiliesSupp(
GetImport().GetModel(), UNO_QUERY );
Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies();
- Any aAny = xFamilies->getByName( sName );
-
- xStyles = *(Reference<XNameContainer>*)aAny.getValue();
- switch( nFamily )
+ if (xFamilies->hasByName(sName))
{
- case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
- ((SvXMLStylesContext *)this)->xParaStyles = xStyles;
- break;
+ Any aAny = xFamilies->getByName( sName );
- case XML_STYLE_FAMILY_TEXT_TEXT:
- ((SvXMLStylesContext *)this)->xTextStyles = xStyles;
- break;
+ xStyles = *(Reference<XNameContainer>*)aAny.getValue();
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TEXT_PARAGRAPH:
+ ((SvXMLStylesContext *)this)->xParaStyles = xStyles;
+ break;
+
+ case XML_STYLE_FAMILY_TEXT_TEXT:
+ ((SvXMLStylesContext *)this)->xTextStyles = xStyles;
+ break;
+ }
}
}