~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to libs/kopageapp/KoPAPageBase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
void KoPAPageBase::saveOdfPageContent( KoPASavingContext & paContext ) const
81
81
{
 
82
    saveOdfLayers(paContext);
82
83
    saveOdfShapes( paContext );
83
84
    saveOdfAnimations( paContext );
84
85
    saveOdfPresentationNotes( paContext );
85
 
    paContext.saveLayerSet( paContext.xmlWriter() );
 
86
}
 
87
 
 
88
void KoPAPageBase::saveOdfLayers(KoPASavingContext &paContext) const
 
89
{
 
90
    QList<KoShape*> shapes(childShapes());
 
91
    qSort(shapes.begin(), shapes.end(), KoShape::compareShapeZIndex);
 
92
    foreach(KoShape* shape, shapes) {
 
93
        KoShapeLayer *layer = dynamic_cast<KoShapeLayer*>(shape);
 
94
        if (layer) {
 
95
            paContext.addLayerForSaving(layer);
 
96
        }
 
97
        else {
 
98
            Q_ASSERT(layer);
 
99
            kWarning(30010) << "Page contains non layer where a layer is expected";
 
100
        }
 
101
    }
 
102
    paContext.saveLayerSet(paContext.xmlWriter());
86
103
    paContext.clearLayers();
87
104
}
88
105
 
100
117
 
101
118
QString KoPAPageBase::saveOdfPageStyle( KoPASavingContext &paContext ) const
102
119
{
103
 
    KoGenStyle style( KoGenStyle::StyleDrawingPage, "drawing-page" );
 
120
    KoGenStyle style( KoGenStyle::DrawingPageAutoStyle, "drawing-page" );
104
121
 
105
122
    if ( paContext.isSet( KoShapeSavingContext::AutoStyleInStyleXml ) ) {
106
123
        style.setAutoStyleInStylesDotXml( true );
108
125
 
109
126
    saveOdfPageStyleData( style, paContext );
110
127
 
111
 
    return paContext.mainStyles().lookup( style, "dp" );
 
128
    return paContext.mainStyles().insert( style, "dp" );
112
129
}
113
130
 
114
131
void KoPAPageBase::saveOdfPageStyleData( KoGenStyle &style, KoPASavingContext &paContext ) const
121
138
        style.setAutoStyleInStylesDotXml( true );
122
139
    }
123
140
 
124
 
    paContext.mainStyles().lookup( style, paContext.isSet( KoShapeSavingContext::PresentationShape ) ? "pr" : "gr" );
 
141
    paContext.mainStyles().insert( style, paContext.isSet( KoShapeSavingContext::PresentationShape ) ? "pr" : "gr" );
125
142
}
126
143
 
127
144
bool KoPAPageBase::saveOdfAnimations( KoPASavingContext & paContext ) const