From koffice-devel Tue Aug 24 12:14:33 2004 From: Ariya Hidayat Date: Tue, 24 Aug 2004 12:14:33 +0000 To: koffice-devel Subject: koffice/kspread Message-Id: <20040824121433.4E6B616B53 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=koffice-devel&m=109334968417922 CVS commit by ariya: load and save sheet's layout direction CCMAIL: 46831@bugs.kde.org CCMAIL: koffice-devel@mail.kde.org M +20 -4 kspread_sheet.cc 1.618 --- koffice/kspread/kspread_sheet.cc #1.617:1.618 @@ -6420,4 +6420,5 @@ QDomElement KSpreadSheet::saveXML( QDomD QDomElement table = doc.createElement( "table" ); table.setAttribute( "name", d->name ); + table.setAttribute( "layoutDirection", (d->layoutDirection == RightToLeft) ? "rtl" : "ltr" ); table.setAttribute( "columnnumber", (int)d->showColumnNumber); table.setAttribute( "borders", (int)d->showPageBorders); @@ -7670,4 +7671,23 @@ bool KSpreadSheet::loadXML( const QDomEl } + bool detectDirection = true; + d->layoutDirection = LeftToRight; + QString layoutDir = table.attribute( "layoutDirection" ); + if( !layoutDir.isEmpty() ) + { + if( layoutDir == "rtl" ) + { + detectDirection = false; + d->layoutDirection = RightToLeft; + } + else if( layoutDir == "ltr" ) + { + detectDirection = false; + d->layoutDirection = LeftToRight; + } + } + if( detectDirection ) + checkContentDirection( d->name ); + /* older versions of KSpread allowed all sorts of characters that the parser won't actually understand. Replace these with '_' @@ -7962,6 +7982,4 @@ bool KSpreadSheet::loadXML( const QDomEl } - checkContentDirection( d->name ); - return true; } @@ -8292,6 +8310,4 @@ bool KSpreadSheet::setTableName( const Q emit sig_nameChanged( this, old_name ); - checkContentDirection( name ); - setName(name.utf8()); (dynamic_cast(dcopObject()))->tableNameHasChanged(); _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel