summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/kivioglobal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kivio/kiviopart/kivioglobal.cpp')
-rw-r--r--kivio/kiviopart/kivioglobal.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/kivio/kiviopart/kivioglobal.cpp b/kivio/kiviopart/kivioglobal.cpp
index 201eea08..7479af08 100644
--- a/kivio/kiviopart/kivioglobal.cpp
+++ b/kivio/kiviopart/kivioglobal.cpp
@@ -44,52 +44,52 @@ struct PaperSizeDef {
int unit;
};
-void Kivio::savePageLayout(TQDomElement& e, const KoPageLayout& layout)
+void Kivio::savePageLayout(TQDomElement& e, const KoPageLayout& tqlayout)
{
- XmlWriteFloat(e, "width", layout.ptWidth);
- XmlWriteFloat(e, "height", layout.ptHeight);
- XmlWriteFloat(e, "marginLeft", layout.ptLeft);
- XmlWriteFloat(e, "marginRight", layout.ptRight);
- XmlWriteFloat(e, "marginTop", layout.ptTop);
- XmlWriteFloat(e, "marginBottom", layout.ptBottom);
- XmlWriteString(e, "format", KoPageFormat::formatString(layout.format));
- XmlWriteString(e, "orientation", Kivio::orientationString(layout.orientation));
+ XmlWriteFloat(e, "width", tqlayout.ptWidth);
+ XmlWriteFloat(e, "height", tqlayout.ptHeight);
+ XmlWriteFloat(e, "marginLeft", tqlayout.ptLeft);
+ XmlWriteFloat(e, "marginRight", tqlayout.ptRight);
+ XmlWriteFloat(e, "marginTop", tqlayout.ptTop);
+ XmlWriteFloat(e, "marginBottom", tqlayout.ptBottom);
+ XmlWriteString(e, "format", KoPageFormat::formatString(tqlayout.format));
+ XmlWriteString(e, "orientation", Kivio::orientationString(tqlayout.orientation));
}
-// ## TODO: remove this method, now that layout.saveOasis() does it all
-KoGenStyle Kivio::savePageLayout(const KoPageLayout& layout)
+// ## TODO: remove this method, now that tqlayout.saveOasis() does it all
+KoGenStyle Kivio::savePageLayout(const KoPageLayout& tqlayout)
{
- return layout.saveOasis();
+ return tqlayout.saveOasis();
}
KoPageLayout Kivio::loadPageLayout(const TQDomElement& e)
{
- KoPageLayout layout;
+ KoPageLayout tqlayout;
if(e.hasAttribute("unit")) {
// Compatibility with Kivio <= 1.2.x
kdDebug(43000) << "Compatibility mode..." << endl;
KoUnit::Unit unit = Kivio::convToKoUnit(XmlReadInt(e, "unit", 0));
- layout.ptWidth = KoUnit::fromUserValue(XmlReadFloat(e, "width", 0.0), unit);
- layout.ptHeight = KoUnit::fromUserValue(XmlReadFloat(e, "height", 0.0), unit);
- layout.ptLeft = KoUnit::fromUserValue(XmlReadFloat(e, "marginLeft", 0.0), unit);
- layout.ptRight = KoUnit::fromUserValue(XmlReadFloat(e, "marginRight", 0.0), unit);
- layout.ptTop = KoUnit::fromUserValue(XmlReadFloat(e, "marginTop", 0.0), unit);
- layout.ptBottom = KoUnit::fromUserValue(XmlReadFloat(e, "marginBottom", 0.0), unit);
- Kivio::setFormatOrientation(layout);
+ tqlayout.ptWidth = KoUnit::fromUserValue(XmlReadFloat(e, "width", 0.0), unit);
+ tqlayout.ptHeight = KoUnit::fromUserValue(XmlReadFloat(e, "height", 0.0), unit);
+ tqlayout.ptLeft = KoUnit::fromUserValue(XmlReadFloat(e, "marginLeft", 0.0), unit);
+ tqlayout.ptRight = KoUnit::fromUserValue(XmlReadFloat(e, "marginRight", 0.0), unit);
+ tqlayout.ptTop = KoUnit::fromUserValue(XmlReadFloat(e, "marginTop", 0.0), unit);
+ tqlayout.ptBottom = KoUnit::fromUserValue(XmlReadFloat(e, "marginBottom", 0.0), unit);
+ Kivio::setFormatOrientation(tqlayout);
kdDebug(43000) << "Ready." << endl;
} else {
- layout.ptWidth = XmlReadFloat(e, "width", 0.0);
- layout.ptHeight = XmlReadFloat(e, "height", 0.0);
- layout.ptLeft = XmlReadFloat(e, "marginLeft", 0.0);
- layout.ptRight = XmlReadFloat(e, "marginRight", 0.0);
- layout.ptTop = XmlReadFloat(e, "marginTop", 0.0);
- layout.ptBottom = XmlReadFloat(e, "marginBottom", 0.0);
- layout.format = KoPageFormat::formatFromString(XmlReadString(e, "format", pageSizeString(KGlobal::locale()->pageSize())));
- layout.orientation = Kivio::orientationFromString(XmlReadString(e, "orientation", "Portrait"));
+ tqlayout.ptWidth = XmlReadFloat(e, "width", 0.0);
+ tqlayout.ptHeight = XmlReadFloat(e, "height", 0.0);
+ tqlayout.ptLeft = XmlReadFloat(e, "marginLeft", 0.0);
+ tqlayout.ptRight = XmlReadFloat(e, "marginRight", 0.0);
+ tqlayout.ptTop = XmlReadFloat(e, "marginTop", 0.0);
+ tqlayout.ptBottom = XmlReadFloat(e, "marginBottom", 0.0);
+ tqlayout.format = KoPageFormat::formatFromString(XmlReadString(e, "format", pageSizeString(KGlobal::locale()->pageSize())));
+ tqlayout.orientation = Kivio::orientationFromString(XmlReadString(e, "orientation", "Portrait"));
}
- return layout;
+ return tqlayout;
}
KoUnit::Unit Kivio::convToKoUnit(int tkUnit)
@@ -132,7 +132,7 @@ KoOrientation Kivio::orientationFromString(const TQString& s)
return PG_PORTRAIT;
}
-void Kivio::setFormatOrientation(KoPageLayout& layout)
+void Kivio::setFormatOrientation(KoPageLayout& tqlayout)
{
const PaperSizeDef PapersTable[] = {
{"A0",841,1189,KoUnit::U_MM},
@@ -166,20 +166,20 @@ void Kivio::setFormatOrientation(KoPageLayout& layout)
PaperSizeDef sizeDef = PapersTable[0];
bool found = false;
float width, height;
- layout.format = PG_CUSTOM;
- layout.orientation = PG_PORTRAIT;
+ tqlayout.format = PG_CUSTOM;
+ tqlayout.orientation = PG_PORTRAIT;
while((sizeDef.unit != -2) && !found) {
width = KoUnit::fromUserValue(sizeDef.width, static_cast<KoUnit::Unit>(sizeDef.unit));
height = KoUnit::fromUserValue(sizeDef.height, static_cast<KoUnit::Unit>(sizeDef.unit));
- if((layout.ptWidth == width) && (layout.ptHeight == height)) {
- layout.format = KoPageFormat::formatFromString(sizeDef.title);
- layout.orientation = PG_PORTRAIT;
+ if((tqlayout.ptWidth == width) && (tqlayout.ptHeight == height)) {
+ tqlayout.format = KoPageFormat::formatFromString(sizeDef.title);
+ tqlayout.orientation = PG_PORTRAIT;
found = true;
- } else if((layout.ptWidth == height) && (layout.ptHeight == width)) {
- layout.format = KoPageFormat::formatFromString(sizeDef.title);
- layout.orientation = PG_LANDSCAPE;
+ } else if((tqlayout.ptWidth == height) && (tqlayout.ptHeight == width)) {
+ tqlayout.format = KoPageFormat::formatFromString(sizeDef.title);
+ tqlayout.orientation = PG_LANDSCAPE;
found = true;
}