Commit ec4a478a authored by Thorsten Zachmann's avatar Thorsten Zachmann

o rename koLoadingContext -> odfLoadingContext

svn path=/trunk/koffice/; revision=770249
parent 21560812
......@@ -149,7 +149,7 @@ QString KoPathShape::saveStyle( KoGenStyle &style, KoShapeSavingContext &context
void KoPathShape::loadStyle( const KoXmlElement & element, KoShapeLoadingContext &context )
{
KoShape::loadStyle( element, context );
KoStyleStack &styleStack = context.koLoadingContext().styleStack();
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
if ( styleStack.hasProperty( KoXmlNS::svg, "fill-rule" ) )
{
QString rule = styleStack.property( KoXmlNS::svg, "fill-rule" );
......
......@@ -695,18 +695,18 @@ QString KoShape::saveStyle( KoGenStyle &style, KoShapeSavingContext &context ) c
void KoShape::loadStyle( const KoXmlElement & element, KoShapeLoadingContext &context )
{
KoStyleStack &styleStack = context.koLoadingContext().styleStack();
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
styleStack.save();
// fill the style stack with the shapes style
if( element.hasAttributeNS( KoXmlNS::draw, "style-name" ) )
{
context.koLoadingContext().fillStyleStack( element, KoXmlNS::draw, "style-name", "graphic" );
context.odfLoadingContext().fillStyleStack( element, KoXmlNS::draw, "style-name", "graphic" );
styleStack.setTypeProperties( "graphic" );
}
else if( element.hasAttributeNS( KoXmlNS::presentation, "style-name" ) )
{
context.koLoadingContext().fillStyleStack( element, KoXmlNS::presentation, "style-name", "presentation" );
context.odfLoadingContext().fillStyleStack( element, KoXmlNS::presentation, "style-name", "presentation" );
styleStack.setTypeProperties( "presentation" );
}
......@@ -767,7 +767,7 @@ bool KoShape::loadOdfAttributes( const KoXmlElement & element, KoShapeLoadingCon
QString KoShape::getStyleProperty( const char *property, const KoXmlElement & element, KoShapeLoadingContext & context )
{
KoStyleStack &styleStack = context.koLoadingContext().styleStack();
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
QString value;
if( element.hasAttributeNS( KoXmlNS::draw, "style-name" ) )
......@@ -786,25 +786,25 @@ QString KoShape::getStyleProperty( const char *property, const KoXmlElement & el
QBrush KoShape::loadOdfFill( const KoXmlElement & element, KoShapeLoadingContext & context )
{
KoStyleStack &styleStack = context.koLoadingContext().styleStack();
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
QString fill = getStyleProperty( "fill", element, context );
if ( fill == "solid" || fill == "hatch" )
return KoOdfGraphicStyles::loadOasisFillStyle( styleStack, fill, context.koLoadingContext().stylesReader() );
return KoOdfGraphicStyles::loadOasisFillStyle( styleStack, fill, context.odfLoadingContext().stylesReader() );
else if( fill == "gradient" )
return KoOdfGraphicStyles::loadOasisGradientStyle( styleStack, context.koLoadingContext().stylesReader(), size() );
return KoOdfGraphicStyles::loadOasisGradientStyle( styleStack, context.odfLoadingContext().stylesReader(), size() );
else if( fill == "bitmap" )
return KoOdfGraphicStyles::loadOasisPatternStyle( styleStack, context.koLoadingContext(), size() );
return KoOdfGraphicStyles::loadOasisPatternStyle( styleStack, context.odfLoadingContext(), size() );
return QBrush();
}
KoShapeBorderModel * KoShape::loadOdfStroke( const KoXmlElement & element, KoShapeLoadingContext & context )
{
KoStyleStack &styleStack = context.koLoadingContext().styleStack();
KoStyleStack &styleStack = context.odfLoadingContext().styleStack();
QString stroke = getStyleProperty( "stroke", element, context );
if( stroke == "solid" || stroke == "dash" )
{
QPen pen = KoOdfGraphicStyles::loadOasisStrokeStyle( styleStack, stroke, context.koLoadingContext().stylesReader() );
QPen pen = KoOdfGraphicStyles::loadOasisStrokeStyle( styleStack, stroke, context.odfLoadingContext().stylesReader() );
KoLineBorder * border = new KoLineBorder();
border->setLineWidth( pen.widthF() );
......
......@@ -60,7 +60,7 @@ KoShapeLoadingContext::~KoShapeLoadingContext()
delete d;
}
KoOdfLoadingContext & KoShapeLoadingContext::koLoadingContext()
KoOdfLoadingContext & KoShapeLoadingContext::odfLoadingContext()
{
return d->context;
}
......
......@@ -53,7 +53,7 @@ public:
~KoShapeLoadingContext();
/// return the embedded loading context
KoOdfLoadingContext & koLoadingContext();
KoOdfLoadingContext & odfLoadingContext();
/// Returns layer referenced by given name
KoShapeLayer * layer( const QString & layerName );
......
......@@ -185,9 +185,9 @@ KoShape * KoShapeRegistry::createShapeFromOdf(const KoXmlElement & e, KoShapeLoa
{
KoShapeGroup * group = new KoShapeGroup();
context.koLoadingContext().styleStack().save();
context.odfLoadingContext().styleStack().save();
bool loaded = group->loadOdf( e, context );
context.koLoadingContext().styleStack().restore();
context.odfLoadingContext().styleStack().restore();
if( loaded )
return group;
......@@ -222,9 +222,9 @@ KoShape * KoShapeRegistry::createShapeInternal( const KoXmlElement & element, Ko
if( shape->shapeId().isEmpty() )
shape->setShapeId(factory->id());
context.koLoadingContext().styleStack().save();
context.odfLoadingContext().styleStack().save();
bool loaded = shape->loadOdf( element, context );
context.koLoadingContext().styleStack().restore();
context.odfLoadingContext().styleStack().restore();
if( loaded )
return shape;
......
......@@ -85,7 +85,7 @@ void KoPAMasterPage::loadOdfPageTag( const KoXmlElement &element, KoPALoadingCon
setName( element.attributeNS( KoXmlNS::style, "name" ) );
}
QString pageLayoutName = element.attributeNS( KoXmlNS::style, "page-layout-name" );
const KoOdfStylesReader& styles = loadingContext.koLoadingContext().stylesReader();
const KoOdfStylesReader& styles = loadingContext.odfLoadingContext().stylesReader();
const KoXmlElement* masterPageStyle = styles.findStyle( pageLayoutName );
KoPageLayout pageLayout = KoPageLayout::standardLayout();
......
......@@ -114,7 +114,7 @@ bool KoPAPageBase::loadOdf( const KoXmlElement &element, KoShapeLoadingContext &
// load layers and shapes
// This needs some work as this is only for layers which are the same for all pages
KoXmlElement layerElement;
forEachElement( layerElement, loadingContext.koLoadingContext().stylesReader().layerSet() )
forEachElement( layerElement, loadingContext.odfLoadingContext().stylesReader().layerSet() )
{
KoShapeLayer * layer = new KoShapeLayer();
if ( layer->loadOdf( layerElement, loadingContext ) ) {
......
......@@ -84,7 +84,7 @@ class KoTextLoader::Private
explicit Private( KoShapeLoadingContext & context )
: context( context )
, textSharedData( 0 )
, stylesDotXml( context.koLoadingContext().useStylesAutoStyles() )
, stylesDotXml( context.odfLoadingContext().useStylesAutoStyles() )
, bodyProgressTotal( 0 )
, bodyProgressValue( 0 )
, lastElapsed( 0 )
......@@ -115,7 +115,7 @@ KoTextLoader::KoTextLoader( KoShapeLoadingContext & context )
if ( !d->textSharedData ) {
d->textSharedData = new KoTextSharedLoadingData();
// TODO pass style manager so that on copy and paste we can recognice the same styles
d->textSharedData->loadOdfStyles( context.koLoadingContext(), 0 );
d->textSharedData->loadOdfStyles( context.odfLoadingContext(), 0 );
if ( !sharedData ) {
context.addSharedData( KOTEXT_SHARED_LOADING_ID, d->textSharedData );
}
......
......@@ -90,7 +90,7 @@ bool TableShape::loadOdf( const KoXmlElement &tableElement,
"style-name",
"" );
const KoXmlElement *tableStyleElement
= context.koLoadingContext().stylesReader().findStyle( tableStyleName,
= context.odfLoadingContext().stylesReader().findStyle( tableStyleName,
"table" );
QString text;
......
......@@ -75,8 +75,8 @@ bool DateVariable::loadOdf( const KoXmlElement & element, KoShapeLoadingContext
QString dateFormat = "";
QString dataStyle = element.attributeNS( KoXmlNS::style, "data-style-name" );
if ( !dataStyle.isEmpty() ) {
if ( context.koLoadingContext().stylesReader().dataFormats().contains( dataStyle ) ) {
KoOdfNumberStyles::NumericStyleFormat dataFormat = context.koLoadingContext().stylesReader().dataFormats().value( dataStyle );
if ( context.odfLoadingContext().stylesReader().dataFormats().contains( dataStyle ) ) {
KoOdfNumberStyles::NumericStyleFormat dataFormat = context.odfLoadingContext().stylesReader().dataFormats().value( dataStyle );
dateFormat = dataFormat.prefix + dataFormat.formatStr + dataFormat.suffix;
}
}
......
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