From 94844816550ad672ccfcdc25659c625546239998 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:32:11 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kivio/kiviopart/kivioglobal.cpp | 76 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'kivio/kiviopart/kivioglobal.cpp') diff --git a/kivio/kiviopart/kivioglobal.cpp b/kivio/kiviopart/kivioglobal.cpp index 7479af08..201eea08 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& tqlayout) +void Kivio::savePageLayout(TQDomElement& e, const KoPageLayout& layout) { - 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)); + 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)); } -// ## TODO: remove this method, now that tqlayout.saveOasis() does it all -KoGenStyle Kivio::savePageLayout(const KoPageLayout& tqlayout) +// ## TODO: remove this method, now that layout.saveOasis() does it all +KoGenStyle Kivio::savePageLayout(const KoPageLayout& layout) { - return tqlayout.saveOasis(); + return layout.saveOasis(); } KoPageLayout Kivio::loadPageLayout(const TQDomElement& e) { - KoPageLayout tqlayout; + KoPageLayout layout; if(e.hasAttribute("unit")) { // Compatibility with Kivio <= 1.2.x kdDebug(43000) << "Compatibility mode..." << endl; KoUnit::Unit unit = Kivio::convToKoUnit(XmlReadInt(e, "unit", 0)); - 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); + 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); kdDebug(43000) << "Ready." << endl; } else { - 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")); + 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")); } - return tqlayout; + return layout; } KoUnit::Unit Kivio::convToKoUnit(int tkUnit) @@ -132,7 +132,7 @@ KoOrientation Kivio::orientationFromString(const TQString& s) return PG_PORTRAIT; } -void Kivio::setFormatOrientation(KoPageLayout& tqlayout) +void Kivio::setFormatOrientation(KoPageLayout& layout) { const PaperSizeDef PapersTable[] = { {"A0",841,1189,KoUnit::U_MM}, @@ -166,20 +166,20 @@ void Kivio::setFormatOrientation(KoPageLayout& tqlayout) PaperSizeDef sizeDef = PapersTable[0]; bool found = false; float width, height; - tqlayout.format = PG_CUSTOM; - tqlayout.orientation = PG_PORTRAIT; + layout.format = PG_CUSTOM; + layout.orientation = PG_PORTRAIT; while((sizeDef.unit != -2) && !found) { width = KoUnit::fromUserValue(sizeDef.width, static_cast(sizeDef.unit)); height = KoUnit::fromUserValue(sizeDef.height, static_cast(sizeDef.unit)); - if((tqlayout.ptWidth == width) && (tqlayout.ptHeight == height)) { - tqlayout.format = KoPageFormat::formatFromString(sizeDef.title); - tqlayout.orientation = PG_PORTRAIT; + if((layout.ptWidth == width) && (layout.ptHeight == height)) { + layout.format = KoPageFormat::formatFromString(sizeDef.title); + layout.orientation = PG_PORTRAIT; found = true; - } else if((tqlayout.ptWidth == height) && (tqlayout.ptHeight == width)) { - tqlayout.format = KoPageFormat::formatFromString(sizeDef.title); - tqlayout.orientation = PG_LANDSCAPE; + } else if((layout.ptWidth == height) && (layout.ptHeight == width)) { + layout.format = KoPageFormat::formatFromString(sizeDef.title); + layout.orientation = PG_LANDSCAPE; found = true; } -- cgit v1.2.1