drawinglayer/source/dumper/XShapeDumper.cxx | 4 ++-- include/vcl/dialog.hxx | 4 ++-- include/vcl/tabdlg.hxx | 2 +- oox/source/drawingml/customshapepresetdata.cxx | 6 +++--- sfx2/source/dialog/tabdlg.cxx | 4 ++-- sw/qa/extras/rtfexport/data/table-rtl.rtf | 5 +++++ sw/qa/extras/rtfexport/rtfexport.cxx | 10 ++++++++++ vcl/source/window/dialog.cxx | 12 ++++++------ vcl/source/window/layout.cxx | 2 +- vcl/source/window/tabdlg.cxx | 2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 +- 11 files changed, 34 insertions(+), 19 deletions(-)
New commits: commit 31bf4242a4eeac718ef4fa8a99eaacfb198249b9 Author: Miklos Vajna <[email protected]> Date: Sat Nov 15 15:20:42 2014 +0100 vcl: let the Dialog ctor take an OUString To make the conversion in the TabDialog ctor unnecessary. Put conversions to other subclasses till they are properly adapted. Change-Id: I6152b6229ce9c840262739cf11812538c9e0a532 diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index c967c95..0636d69 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -69,7 +69,7 @@ public: protected: explicit Dialog( WindowType nType ); - explicit Dialog( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, WindowType nType ); + explicit Dialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, WindowType nType ); virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE; virtual void settingOptimalLayoutSize(VclBox *pBox) SAL_OVERRIDE; @@ -80,7 +80,7 @@ protected: public: explicit Dialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG ); - explicit Dialog( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ); + explicit Dialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ); virtual ~Dialog(); virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index afb2197..9489d5b 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -485,18 +485,18 @@ void Dialog::doDeferredInit(WinBits nBits) mbIsDefferedInit = false; } -Dialog::Dialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription) +Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription) : SystemWindow(WINDOW_DIALOG) { ImplInitDialogData(); - loadUI(pParent, rID, rUIXMLDescription); + loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription); } -Dialog::Dialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, WindowType nType) +Dialog::Dialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, WindowType nType) : SystemWindow(nType) { ImplInitDialogData(); - loadUI(pParent, rID, rUIXMLDescription); + loadUI(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription); } Dialog::Dialog(vcl::Window* pParent, WinBits nStyle) @@ -1153,7 +1153,7 @@ VclBuilderContainer::~VclBuilderContainer() } ModelessDialog::ModelessDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription) - : Dialog(pParent, rID, rUIXMLDescription, WINDOW_MODELESSDIALOG) + : Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_MODELESSDIALOG) { } @@ -1164,7 +1164,7 @@ ModalDialog::ModalDialog( vcl::Window* pParent, WinBits nStyle ) : } ModalDialog::ModalDialog( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, rID, rUIXMLDescription, WINDOW_MODALDIALOG) + Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_MODALDIALOG) { } diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 590525f..bb6e8f1 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1980,7 +1980,7 @@ MessageDialog::MessageDialog(vcl::Window* pParent, } MessageDialog::MessageDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription) - : Dialog(pParent, rID, rUIXMLDescription, WINDOW_MESSBOX) + : Dialog(pParent, OStringToOUString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_MESSBOX) , m_eButtonsType(VCL_BUTTONS_NONE) , m_eMessageType(VCL_MESSAGE_INFO) , m_pOwnedContentArea(NULL) diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 9a2de75..f15a2a0 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -214,7 +214,7 @@ TabDialog::TabDialog( vcl::Window* pParent, WinBits nStyle ) : } TabDialog::TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_TABDIALOG) + Dialog(pParent, rID, rUIXMLDescription, WINDOW_TABDIALOG) { ImplInitTabDialogData(); } commit 27b1ae5bb8aae0a2368799367e56b2f0b95a6cd9 Author: Miklos Vajna <[email protected]> Date: Sat Nov 15 15:20:19 2014 +0100 drawinglayer: these are expected to be UTF-8 Change-Id: Ic2054af851bb9d195be4d550f36b1d7349f90204 diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx b/drawinglayer/source/dumper/XShapeDumper.cxx index c0d1979..c64ba81 100644 --- a/drawinglayer/source/dumper/XShapeDumper.cxx +++ b/drawinglayer/source/dumper/XShapeDumper.cxx @@ -1957,7 +1957,7 @@ OUString XShapeDumper::dump(uno::Reference<drawing::XShapes> xPageShapes, bool b xmlTextWriterEndDocument( xmlWriter ); xmlFreeTextWriter( xmlWriter ); - return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); + return OUString::fromUtf8(aString.makeStringAndClear()); } OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bDumpInteropProperties) @@ -1981,7 +1981,7 @@ OUString XShapeDumper::dump(uno::Reference<drawing::XShape> xPageShapes, bool bD xmlTextWriterEndDocument( xmlWriter ); xmlFreeTextWriter( xmlWriter ); - return OStringToOUString(aString.makeStringAndClear(), RTL_TEXTENCODING_UTF8); + return OUString::fromUtf8(aString.makeStringAndClear()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 369eb9bfba507c72165f2797acd2cd28e692c5d1 Author: Miklos Vajna <[email protected]> Date: Sat Nov 15 15:19:56 2014 +0100 TabDialog ctor: take an OUString Change-Id: Ie390fb9debe3a80b3ebc5e609119723c78eadba2 diff --git a/include/vcl/tabdlg.hxx b/include/vcl/tabdlg.hxx index e4f4248..f02efc7 100644 --- a/include/vcl/tabdlg.hxx +++ b/include/vcl/tabdlg.hxx @@ -40,7 +40,7 @@ private: public: TabDialog( vcl::Window* pParent, WinBits nStyle = WB_STDTABDIALOG ); - TabDialog( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ); + TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ); virtual ~TabDialog(); virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 2a70d20..1481fbd 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -316,7 +316,7 @@ SfxTabDialog::SfxTabDialog // can be NULL, when Pages are onDemand bool bEditFmt // when yes -> additional Button for standard ) - : TabDialog(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription) + : TabDialog(pParent, rID, rUIXMLDescription) , pFrame(pViewFrame) , pSet(pItemSet) , pOutSet(0) @@ -345,7 +345,7 @@ SfxTabDialog::SfxTabDialog // can be NULL, when Pages are onDemand bool bEditFmt // when yes -> additional Button for standard ) - : TabDialog(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription) + : TabDialog(pParent, rID, rUIXMLDescription) , pFrame(0) , pSet(pItemSet) , pOutSet(0) diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index c3258b4..9a2de75 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -213,8 +213,8 @@ TabDialog::TabDialog( vcl::Window* pParent, WinBits nStyle ) : ImplInit( pParent, nStyle ); } -TabDialog::TabDialog( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, rID, rUIXMLDescription, WINDOW_TABDIALOG) +TabDialog::TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ) : + Dialog(pParent, OUStringToOString(rID, RTL_TEXTENCODING_UTF8), rUIXMLDescription, WINDOW_TABDIALOG) { ImplInitTabDialogData(); } commit 6be63430c0a73549e0e5d49f6bb4fd1573a854b1 Author: Miklos Vajna <[email protected]> Date: Sat Nov 15 15:19:36 2014 +0100 oox: these are expected to be UTF-8 Change-Id: I2e9cb96948d7f990dd8be5f4505f00306fa62f8f diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index 0eadef1..2edc40c 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -34,7 +34,7 @@ void lcl_parseAdjustmentValue(comphelper::SequenceAsVector<drawing::EnhancedCust if (aToken.startsWith(aNamePrefix)) { OString aName = aToken.copy(aNamePrefix.getLength(), aToken.getLength() - aNamePrefix.getLength() - strlen("\"")); - aAdjustmentValue.Name = OStringToOUString(aName, RTL_TEXTENCODING_UTF8); + aAdjustmentValue.Name = OUString::fromUtf8(aName); } else if (aToken.startsWith(aValuePrefix)) { @@ -414,7 +414,7 @@ void lcl_parseEquations(comphelper::SequenceAsVector<OUString>& rEquations, cons else if (rValue[i] == '"' && bInString) { bInString = false; - rEquations.push_back(OStringToOUString(rValue.copy(nStart + strlen("\""), i - nStart - strlen("\"")), RTL_TEXTENCODING_UTF8)); + rEquations.push_back(OUString::fromUtf8(rValue.copy(nStart + strlen("\""), i - nStart - strlen("\"")))); } } } @@ -734,7 +734,7 @@ void CustomShapeProperties::initializePresetDataMap() bFirst = false; else maPresetDataMap[StaticTokenMap::get().getTokenFromUnicode(aName)] = aPropertyMap; - aName = OStringToOUString(aLine.copy(aCommentPrefix.getLength(), aLine.getLength() - aCommentPrefix.getLength() - strlen(" */")), RTL_TEXTENCODING_UTF8); + aName = OUString::fromUtf8(aLine.copy(aCommentPrefix.getLength(), aLine.getLength() - aCommentPrefix.getLength() - strlen(" */"))); } else { commit 08eaac43602964029beac4e05102267bcb05c407 Author: Miklos Vajna <[email protected]> Date: Sat Nov 15 15:19:11 2014 +0100 RTF import: handle right-to-left tables Change-Id: If2e60557b7551839c344d56cb3a720ae3659e93c diff --git a/sw/qa/extras/rtfexport/data/table-rtl.rtf b/sw/qa/extras/rtfexport/data/table-rtl.rtf new file mode 100644 index 0000000..bba72e0 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/table-rtl.rtf @@ -0,0 +1,5 @@ +{\rtf1 +\trowd\rtlrow\cellx4703\cellx9514 +\pard\plain\intbl A1\cell B1\cell\row +\pard\plain\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index de27537..593f01e 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/text/XFootnotesSupplier.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> +#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <vcl/svapp.hxx> @@ -826,6 +827,15 @@ DECLARE_RTFEXPORT_TEST(testCjklist38, "cjklist38.rtf") CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH, numFormat); } +DECLARE_RTFEXPORT_TEST(testTableRtl, "table-rtl.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // This was text::WritingMode2::LR_TB, i.e. direction of the table was ignored. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 0b59659..c321111 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3007,7 +3007,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) break; case RTF_LTRROW: case RTF_RTLROW: - // dmapper does not support these. + m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblPrBase_bidiVisual, RTFValue::Pointer_t(new RTFValue(nKeyword == RTF_RTLROW))); break; case RTF_LTRCH: // dmapper does not support this. _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
