diff options
author | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
commit | 06ec1c089519ef3249464aa09eadf03a8db93a39 (patch) | |
tree | 85b2eb6d8ba6ca95e18e1ff82151224cb14106f6 /starmath | |
parent | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (diff) | |
parent | 3f899eae02eaad0b967de749fe09b869ba93ad6d (diff) |
Merge branch 'master' into feature/killsdf
Conflicts:
Repository.mk
RepositoryFixes.mk
connectivity/prj/build.lst
extensions/prj/build.lst
filter/prj/build.lst
fpicker/prj/build.lst
l10ntools/StaticLibrary_transex.mk
saxon/build.xml
shell/prj/build.lst
solenv/gbuild/AllLangResTarget.mk
solenv/gbuild/Configuration.mk
solenv/gbuild/UI.mk
ucb/source/ucp/webdav/webdavcontent.cxx
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/CppunitTest_starmath_qa_cppunit.mk | 3 | ||||
-rw-r--r-- | starmath/inc/dialog.hxx | 2 | ||||
-rw-r--r-- | starmath/inc/document.hxx | 4 | ||||
-rw-r--r-- | starmath/inc/node.hxx | 16 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 4 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_nodetotextvisitors.cxx | 20 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_starmath.cxx | 4 | ||||
-rw-r--r-- | starmath/source/accessibility.cxx | 26 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 24 | ||||
-rw-r--r-- | starmath/source/document.cxx | 12 | ||||
-rw-r--r-- | starmath/source/mathmlexport.cxx | 7 | ||||
-rw-r--r-- | starmath/source/mathtype.cxx | 17 | ||||
-rw-r--r-- | starmath/source/node.cxx | 34 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 22 | ||||
-rw-r--r-- | starmath/source/symbol.cxx | 4 | ||||
-rw-r--r-- | starmath/source/view.cxx | 66 | ||||
-rw-r--r-- | starmath/uiconfig/smath/menubar/menubar.xml | 5 | ||||
-rw-r--r-- | starmath/uiconfig/smath/ui/printeroptions.ui | 10 |
18 files changed, 144 insertions, 136 deletions
diff --git a/starmath/CppunitTest_starmath_qa_cppunit.mk b/starmath/CppunitTest_starmath_qa_cppunit.mk index efde9b438482..90d379933aa2 100644 --- a/starmath/CppunitTest_starmath_qa_cppunit.mk +++ b/starmath/CppunitTest_starmath_qa_cppunit.mk @@ -48,7 +48,10 @@ $(eval $(call gb_CppunitTest_use_libraries,starmath_qa_cppunit,\ editeng \ i18nisolang1 \ i18nutil \ + msfilter \ + oox \ sal \ + sax \ sfx \ sot \ svl \ diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6636ad0330e4..51782f0ecb91 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -514,7 +514,7 @@ public: bool SelectFont(const OUString &rFontName) { return SelectFont(rFontName, true); } bool SelectStyle(const OUString &rStyleName) { return SelectStyle(rStyleName, true); }; - void SelectChar(xub_Unicode cChar); + void SelectChar(sal_Unicode cChar); }; diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index 4d98b82c751d..638801371f19 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -96,7 +96,7 @@ class SmDocShell : public SfxObjectShell, public SfxListener String aText; SmFormat aFormat; SmParser aInterpreter; - String aAccText; + OUString aAccText; SmNode *pTree; SfxMenuBarManager *pMenuMgr; SfxItemPool *pEditEngineItemPool; @@ -198,7 +198,7 @@ public: const std::set< rtl::OUString > & GetUsedSymbols() const { return aUsedSymbols; } - String GetAccessibleText(); + OUString GetAccessibleText(); EditEngine & GetEditEngine(); SfxItemPool & GetEditEngineItemPool(); diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 45c96696d433..7a89a7a2d64b 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -156,7 +156,7 @@ public: virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); virtual void CreateTextFromNode(String &rText); - virtual void GetAccessibleText( String &rText ) const; + virtual void GetAccessibleText( OUStringBuffer &rText ) const; sal_Int32 GetAccessibleIndex() const { return nAccIndex; } const SmNode * FindNodeWithAccessibleIndex(xub_StrLen nAccIndex) const; @@ -190,7 +190,7 @@ public: /** The tree as dot graph for graphviz, usable for debugging * Convert the output to a image using $ dot graph.gv -Tpng > graph.png */ - inline void DumpAsDot(std::ostream &out, String* label = NULL) const{ + inline void DumpAsDot(std::ostream &out, OUString* label = NULL) const{ int id = 0; DumpAsDot(out, label, -1, id, -1); } @@ -230,7 +230,7 @@ protected: } private: SmStructureNode* aParentNode; - void DumpAsDot(std::ostream &out, String* label, int number, int& id, int parent) const; + void DumpAsDot(std::ostream &out, OUString* label, int number, int& id, int parent) const; }; //////////////////////////////////////////////////////////////////////////////// @@ -324,7 +324,7 @@ public: SmStructureNode & operator = ( const SmStructureNode &rNode ); - virtual void GetAccessibleText( String &rText ) const; + virtual void GetAccessibleText( OUStringBuffer &rText ) const; void SetSubNode(size_t nIndex, SmNode* pNode) { @@ -378,7 +378,7 @@ protected: public: - virtual void GetAccessibleText( String &rText ) const; + virtual void GetAccessibleText( OUStringBuffer &rText ) const; }; @@ -490,7 +490,7 @@ public: virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); virtual void CreateTextFromNode(String &rText); - virtual void GetAccessibleText( String &rText ) const; + virtual void GetAccessibleText( OUStringBuffer &rText ) const; void Accept(SmVisitor* pVisitor); /** Converts the character from StarMath's private area symbols to a matching Unicode @@ -561,8 +561,8 @@ protected: SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken) : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH) { - xub_Unicode cChar = GetToken().cMathChar; - if ((xub_Unicode) '\0' != cChar) + sal_Unicode cChar = GetToken().cMathChar; + if ((sal_Unicode) '\0' != cChar) SetText(rtl::OUString(cChar)); } diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 7707c5076152..f508cf5a87a1 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -228,7 +228,7 @@ class SmViewShell: public SfxViewShell SmGraphicWindow aGraphic; SmGraphicController aGraphicController; - String StatusText; + OUString aStatusText; ::com::sun::star::uno:: Reference < ::com::sun::star::lang:: XEventListener > xClipEvtLstnr; @@ -292,7 +292,7 @@ public: SmGraphicWindow & GetGraphicWindow() { return aGraphic; } const SmGraphicWindow & GetGraphicWindow() const { return aGraphic; } - void SetStatusText(const String& Text); + void SetStatusText(const OUString& rText); void ShowError( const SmErrorDesc *pErrorDesc ); void NextError(); diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index b7e363ca4818..375b73300b2c 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -145,7 +145,7 @@ Test::Test() //of retaining references to the root ServiceFactory as its passed around comphelper::setProcessServiceFactory(xSM); - InitVCL(xSM); + InitVCL(); SmGlobals::ensure(); } @@ -557,7 +557,7 @@ void Test::testBinomInBinHor() // tack +d on the end, which will put the binom into an SmBinHorNode aCursor.InsertElement(PlusElement); - aCursor.InsertText('d'); + aCursor.InsertText("d"); sExpected.AppendAscii(" { { binom a b + c } + d } "); CPPUNIT_ASSERT_EQUAL_MESSAGE("Binom Node in BinHor Node", sExpected, xDocShRef->GetText()); @@ -588,7 +588,7 @@ void Test::testBinVerInUnary() // set up a fraction aCursor.InsertFraction(); aCursor.Move(&aOutputDevice, MoveDown); - aCursor.InsertText('2'); + aCursor.InsertText("2"); sExpected.AppendAscii(" - { 1 over 2 } "); CPPUNIT_ASSERT_EQUAL_MESSAGE("Binary Vertical in Unary Operator", sExpected, xDocShRef->GetText()); @@ -610,16 +610,16 @@ void Test::testBinHorInSubSup() TestOutputDevice aOutputDevice; // Insert an RSup expression with a BinHor for the exponent - aCursor.InsertText('a'); + aCursor.InsertText("a"); aCursor.InsertSubSup(RSUP); - aCursor.InsertText('b'); + aCursor.InsertText("b"); aCursor.InsertElement(PlusElement); - aCursor.InsertText('c'); + aCursor.InsertText("c"); // Move to the end and add d to the expression aCursor.Move(&aOutputDevice, MoveRight); aCursor.InsertElement(PlusElement); - aCursor.InsertText('d'); + aCursor.InsertText("d"); sExpected.AppendAscii(" { a rsup { b + c } + d } "); CPPUNIT_ASSERT_EQUAL_MESSAGE("BinHor in SubSup", sExpected, xDocShRef->GetText()); @@ -652,13 +652,13 @@ void Test::testUnaryInMixedNumberAsNumerator() // Set up a fraction aCursor.InsertFraction(); aCursor.Move(&aOutputDevice, MoveDown); - aCursor.InsertText('2'); + aCursor.InsertText("2"); // Move left and turn this into a mixed number // (bad form, but this could happen right?) aCursor.Move(&aOutputDevice, MoveLeft); aCursor.Move(&aOutputDevice, MoveLeft); - aCursor.InsertText('2'); + aCursor.InsertText("2"); // move forward (more than) enough places to be at the end for (i = 0; i < 8; ++i) @@ -666,7 +666,7 @@ void Test::testUnaryInMixedNumberAsNumerator() // add 4 to the end aCursor.InsertElement(PlusElement); - aCursor.InsertText('4'); + aCursor.InsertText("4"); sExpected.AppendAscii(" { 2 { - 1 over 2 } + 4 } "); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unary in mixed number as Numerator", sExpected, xDocShRef->GetText()); diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index bbea57bb0f26..3e39f5d42123 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -115,7 +115,7 @@ Test::Test() //of retaining references to the root ServiceFactory as its passed around comphelper::setProcessServiceFactory(xSM); - InitVCL(xSM); + InitVCL(); SmGlobals::ensure(); } @@ -240,7 +240,7 @@ void Test::tmEditAllClipboard() void Test::tmEditFailure() { - m_xDocShRef->SetText("color a b over {a/}"); + m_xDocShRef->SetText(String("color a b over {a/}")); const SmErrorDesc *pErrorDesc = m_xDocShRef->GetParser().NextError(); diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 331790a606e0..508208c27e81 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -514,10 +514,11 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde OSL_ENSURE( nAccIndex >= 0, "invalid accessible index" ); OSL_ENSURE( nIndex >= nAccIndex, "index out of range" ); - String aNodeText; - pNode->GetAccessibleText( aNodeText ); + OUStringBuffer aBuf; + pNode->GetAccessibleText(aBuf); + OUString aNodeText = aBuf.makeStringAndClear(); sal_Int32 nNodeIndex = nIndex - nAccIndex; - if (0 <= nNodeIndex && nNodeIndex < aNodeText.Len()) + if (0 <= nNodeIndex && nNodeIndex < aNodeText.getLength()) { // get appropriate rectangle Point aOffset(pNode->GetTopLeft() - pTree->GetTopLeft()); @@ -525,9 +526,9 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde aTLPos.X() -= 0; Size aSize (pNode->GetSize()); - sal_Int32 *pXAry = new sal_Int32[ aNodeText.Len() ]; + sal_Int32 *pXAry = new sal_Int32[ aNodeText.getLength() ]; pWin->SetFont( pNode->GetFont() ); - pWin->GetTextArray( aNodeText, pXAry, 0, aNodeText.Len() ); + pWin->GetTextArray( aNodeText, pXAry, 0, aNodeText.getLength() ); aTLPos.X() += nNodeIndex > 0 ? pXAry[nNodeIndex - 1] : 0; aSize.Width() = nNodeIndex > 0 ? pXAry[nNodeIndex] - pXAry[nNodeIndex - 1] : pXAry[nNodeIndex]; delete[] pXAry; @@ -600,22 +601,23 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getIndexAtPoint( const awt::Point& aPoin if (aRect.IsInside( aPos )) { OSL_ENSURE( pNode->IsVisible(), "node is not a leaf" ); - String aTxt; - pNode->GetAccessibleText( aTxt ); - OSL_ENSURE( aTxt.Len(), "no accessible text available" ); + OUStringBuffer aBuf; + pNode->GetAccessibleText(aBuf); + OUString aTxt = aBuf.makeStringAndClear(); + OSL_ENSURE( !aTxt.isEmpty(), "no accessible text available" ); long nNodeX = pNode->GetLeft(); - sal_Int32 *pXAry = new sal_Int32[ aTxt.Len() ]; + sal_Int32 *pXAry = new sal_Int32[ aTxt.getLength() ]; pWin->SetFont( pNode->GetFont() ); - pWin->GetTextArray( aTxt, pXAry, 0, aTxt.Len() ); - for (sal_Int32 i = 0; i < aTxt.Len() && nRes == -1; ++i) + pWin->GetTextArray( aTxt, pXAry, 0, aTxt.getLength() ); + for (sal_Int32 i = 0; i < aTxt.getLength() && nRes == -1; ++i) { if (pXAry[i] + nNodeX > aPos.X()) nRes = i; } delete[] pXAry; - OSL_ENSURE( nRes >= 0 && nRes < aTxt.Len(), "index out of range" ); + OSL_ENSURE( nRes >= 0 && nRes < aTxt.getLength(), "index out of range" ); OSL_ENSURE( pNode->GetAccessibleIndex() >= 0, "invalid accessible index" ); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 82a0e7228068..c0cc81f4203c 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -35,7 +35,6 @@ #include <vcl/wall.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/sfx.hrc> -#include <tools/string.hxx> #include <osl/diagnose.h> #include <svx/ucsubset.hxx> @@ -51,8 +50,6 @@ #include "unomodel.hxx" -using ::rtl::OUString; - // Since it's better to set/query the FontStyle via its attributes rather // than via the StyleName we create a way to translate // Attribute <-> StyleName @@ -1183,7 +1180,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) int nIV = i - v; sal_UCS4 cChar = aSymbol.GetCharacter(); - String aText( OUString( &cChar, 1 ) ); + OUString aText(&cChar, 1); Size aSize( GetTextWidth( aText ), GetTextHeight()); DrawText(Point((nIV % nColumns) * nLen + (nLen - aSize.Width()) / 2, @@ -1383,7 +1380,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) SetFont(aFont); sal_UCS4 cChar = pSymbol->GetCharacter(); - String aText( OUString( &cChar, 1 ) ); + OUString aText(&cChar, 1); SetText( aText ); } @@ -1505,13 +1502,12 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG pButton ) const SmSym *pSym = GetSymbol(); if (pSym) { - String aText = rtl::OUString('%'); - aText += pSym->GetName(); - aText += (sal_Unicode)' '; + OUStringBuffer aText; + aText.append('%').append(pSym->GetName()).append(' '); rViewSh.GetViewFrame()->GetDispatcher()->Execute( SID_INSERTSYMBOL, SFX_CALLMODE_STANDARD, - new SfxStringItem(SID_INSERTSYMBOL, aText), 0L); + new SfxStringItem(SID_INSERTSYMBOL, aText.makeStringAndClear()), 0L); } return 0; @@ -1709,7 +1705,7 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont ) SetFont(aFont); aFont.SetTransparent(true); - String aText( OUString( &cChar, 1) ); + OUString aText(&cChar, 1); SetText( aText ); Invalidate(); @@ -1920,9 +1916,9 @@ IMPL_LINK_NOARG(SmSymDefineDialog, CharHighlightHdl) UpdateButtons(); // display Unicode position as symbol name while iterating over characters - const String aHex(rtl::OUString::valueOf(static_cast<sal_Int64>(cChar), 16 ).toAsciiUpperCase()); - const String aPattern( OUString::createFromAscii( aHex.Len() > 4 ? "Ux000000" : "Ux0000" ) ); - String aUnicodePos( aPattern.Copy( 0, aPattern.Len() - aHex.Len() ) ); + const OUString aHex(rtl::OUString::valueOf(static_cast<sal_Int64>(cChar), 16 ).toAsciiUpperCase()); + const OUString aPattern( (aHex.getLength() > 4) ? OUString("Ux000000") : OUString("Ux0000") ); + OUString aUnicodePos( aPattern.copy( 0, aPattern.getLength() - aHex.getLength() ) ); aUnicodePos += aHex; aSymbols.SetText( aUnicodePos ); aSymbolName.SetText( aUnicodePos ); @@ -2485,7 +2481,7 @@ bool SmSymDefineDialog::SelectStyle(const OUString &rStyleName, bool bApplyFont) } -void SmSymDefineDialog::SelectChar(xub_Unicode cChar) +void SmSymDefineDialog::SelectChar(sal_Unicode cChar) { aCharsetDisplay.SelectCharacter( cChar ); aSymbolDisplay.SetSymbol( cChar, aCharsetDisplay.GetFont() ); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index da9dd3e6ee1a..6dc19f5b9fa0 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -224,17 +224,21 @@ void SmDocShell::SetFormat(SmFormat& rFormat) } } -String SmDocShell::GetAccessibleText() +OUString SmDocShell::GetAccessibleText() { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::GetAccessibleText" ); if (!IsFormulaArranged()) ArrangeFormula(); - if (0 == aAccText.Len()) + if (aAccText.isEmpty()) { OSL_ENSURE( pTree, "Tree missing" ); if (pTree) - pTree->GetAccessibleText( aAccText ); + { + OUStringBuffer aBuf; + pTree->GetAccessibleText(aBuf); + aAccText = aBuf.makeStringAndClear(); + } } return aAccText; } @@ -306,7 +310,7 @@ void SmDocShell::ArrangeFormula() SetFormulaArranged(true); // invalidate accessible text - aAccText = String(); + aAccText = OUString(); } diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 1ecaff1db896..33628915c80a 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/xml/sax/InputSource.hpp> #include <com/sun/star/xml/sax/XDTDHandler.hpp> #include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XActiveDataControl.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> @@ -51,6 +52,7 @@ #include <unotools/saveopt.hxx> #include <svl/stritem.hxx> #include <svl/itemprop.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <unotools/streamwrap.hxx> #include <sax/tools/converter.hxx> @@ -265,9 +267,8 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent( OSL_ENSURE(NULL != pComponentName, "Need component name!"); // get component - Reference< io::XActiveDataSource > xSaxWriter( - rFactory->createInstance( "com.sun.star.xml.sax.Writer" ), - UNO_QUERY ); + Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create( + comphelper::getComponentContext(rFactory) ); OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML writer" ); if (!xSaxWriter.is()) return sal_False; diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 69aeabe2ce77..b911b5f4a890 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -699,17 +699,14 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, rRet.Insert(aStr,nTextStart); rRet += '\"'; } - else + else if (nRecord == END && rRet.Len() > 0) { - if (nRecord == END) - { - sal_Unicode cChar = 0; - xub_StrLen nI = rRet.Len()-1; - while (nI && ((cChar = rRet.GetChar(nI)) == ' ')) - --nI; - if ((cChar == '=') || (cChar == '+') || (cChar == '-')) - APPEND(rRet,"{}"); - } + sal_Unicode cChar = 0; + xub_StrLen nI = rRet.Len()-1; + while (nI && ((cChar = rRet.GetChar(nI)) == ' ')) + --nI; + if ((cChar == '=') || (cChar == '+') || (cChar == '-')) + APPEND(rRet,"{}"); } } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 972f725827a0..4760d9279824 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -520,7 +520,7 @@ const SmNode * SmNode::FindRectClosestTo(const Point &rPoint) const return pResult; } -void SmNode::GetAccessibleText( String &/*rText*/ ) const +void SmNode::GetAccessibleText( OUStringBuffer &/*rText*/ ) const { OSL_FAIL( "SmNode: GetAccessibleText not overloaded" ); } @@ -530,12 +530,12 @@ const SmNode * SmNode::FindNodeWithAccessibleIndex(xub_StrLen nAccIdx) const const SmNode *pResult = 0; sal_Int32 nIdx = GetAccessibleIndex(); - String aTxt; + OUStringBuffer aTxt; if (nIdx >= 0) GetAccessibleText( aTxt ); // get text if used in following 'if' statement if (nIdx >= 0 - && nIdx <= nAccIdx && nAccIdx < nIdx + aTxt.Len()) + && nIdx <= nAccIdx && nAccIdx < nIdx + aTxt.getLength()) pResult = this; else { @@ -556,18 +556,18 @@ const SmNode * SmNode::FindNodeWithAccessibleIndex(xub_StrLen nAccIdx) const } #ifdef DEBUG_ENABLE_DUMPASDOT -void SmNode::DumpAsDot(std::ostream &out, String* label, int number, int& id, int parent) const +void SmNode::DumpAsDot(std::ostream &out, OUString* label, int number, int& id, int parent) const { //If this is the root start the file if(number == -1){ out<<"digraph {"<<std::endl; if(label){ out<<"labelloc = \"t\";"<<std::endl; - String eq(*label); + OUString eq(*label); //CreateTextFromNode(eq); - eq.SearchAndReplaceAll(String::CreateFromAscii("\n"), String::CreateFromAscii(" ")); - eq.SearchAndReplaceAll(String::CreateFromAscii("\\"), String::CreateFromAscii("\\\\")); - eq.SearchAndReplaceAll(String::CreateFromAscii("\""), String::CreateFromAscii("\\\"")); + eq = eq.replaceAll("\n", " "); + eq = eq.replaceAll("\\", "\\\\"); + eq = eq.replaceAll("\"", "\\\""); out<<"label= \"Equation: \\\""; out<< rtl::OUStringToOString(eq, RTL_TEXTENCODING_UTF8).getStr(); out<<"\\\"\";"<<std::endl; @@ -749,7 +749,7 @@ SmNode * SmStructureNode::GetSubNode(sal_uInt16 nIndex) } -void SmStructureNode::GetAccessibleText( String &rText ) const +void SmStructureNode::GetAccessibleText( OUStringBuffer &rText ) const { sal_uInt16 nNodes = GetNumSubNodes(); for (sal_uInt16 i = 0; i < nNodes; ++i) @@ -758,7 +758,7 @@ void SmStructureNode::GetAccessibleText( String &rText ) const if (pNode) { if (pNode->IsVisible()) - ((SmStructureNode *) pNode)->nAccIndex = rText.Len(); + ((SmStructureNode *) pNode)->nAccIndex = rText.getLength(); pNode->GetAccessibleText( rText ); } } @@ -787,9 +787,9 @@ SmNode * SmVisibleNode::GetSubNode(sal_uInt16 /*nIndex*/) /////////////////////////////////////////////////////////////////////////// -void SmGraphicNode::GetAccessibleText( String &rText ) const +void SmGraphicNode::GetAccessibleText( OUStringBuffer &rText ) const { - rText += GetToken().aText; + rText.append(GetToken().aText); } /////////////////////////////////////////////////////////////////////////// @@ -1750,7 +1750,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) aTmpSize.Width() *= 182; aTmpSize.Width() /= 267; - xub_Unicode cChar = pLeft->GetToken().cMathChar; + sal_Unicode cChar = pLeft->GetToken().cMathChar; if (cChar != MS_LINE && cChar != MS_DLINE) pLeft ->GetFont().SetSize(aTmpSize); @@ -2440,9 +2440,9 @@ void SmTextNode::CreateTextFromNode(String &rText) } -void SmTextNode::GetAccessibleText( String &rText ) const +void SmTextNode::GetAccessibleText( OUStringBuffer &rText ) const { - rText += aText; + rText.append(aText); } void SmTextNode::AdjustFontDesc() @@ -2651,8 +2651,8 @@ SmNode * SmMatrixNode::GetLeftMost() SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken) : SmSpecialNode(NMATH, rNodeToken, FNT_MATH) { - xub_Unicode cChar = GetToken().cMathChar; - if ((xub_Unicode) '\0' != cChar) + sal_Unicode cChar = GetToken().cMathChar; + if ((sal_Unicode) '\0' != cChar) SetText(rtl::OUString(cChar)); } diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index fc93660ab8bc..31cf876f35ac 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -35,17 +35,17 @@ // '\0' terminated Array with symbol, which should be treat as letters in // StarMath Font, (to get a normal (non-clipped) SmRect in contrast to the // other operators and symbols). -static xub_Unicode const aMathAlpha[] = +static sal_Unicode const aMathAlpha[] = { MS_ALEPH, MS_IM, MS_RE, - MS_WP, xub_Unicode(0xE070), MS_EMPTYSET, - xub_Unicode(0x2113), xub_Unicode(0xE0D6), xub_Unicode(0x2107), - xub_Unicode(0x2127), xub_Unicode(0x210A), MS_HBAR, + MS_WP, sal_Unicode(0xE070), MS_EMPTYSET, + sal_Unicode(0x2113), sal_Unicode(0xE0D6), sal_Unicode(0x2107), + sal_Unicode(0x2127), sal_Unicode(0x210A), MS_HBAR, MS_LAMBDABAR, MS_SETN, MS_SETZ, MS_SETQ, MS_SETR, MS_SETC, - xub_Unicode(0x2373), xub_Unicode(0xE0A5), xub_Unicode(0x2112), - xub_Unicode(0x2130), xub_Unicode(0x2131), - xub_Unicode('\0') + sal_Unicode(0x2373), sal_Unicode(0xE0A5), sal_Unicode(0x2112), + sal_Unicode(0x2130), sal_Unicode(0x2131), + sal_Unicode('\0') }; bool SmIsMathAlpha(const rtl::OUString &rText) @@ -55,18 +55,18 @@ bool SmIsMathAlpha(const rtl::OUString &rText) return false; OSL_ENSURE(rText.getLength() == 1, "Sm : string must be exactly one character long"); - xub_Unicode cChar = rText[0]; + sal_Unicode cChar = rText[0]; // is it a greek symbol? - if (xub_Unicode(0xE0AC) <= cChar && cChar <= xub_Unicode(0xE0D4)) + if (sal_Unicode(0xE0AC) <= cChar && cChar <= sal_Unicode(0xE0D4)) return true; else { // appears it in 'aMathAlpha'? - const xub_Unicode *pChar = aMathAlpha; + const sal_Unicode *pChar = aMathAlpha; while (*pChar && *pChar != cChar) pChar++; - return *pChar != xub_Unicode('\0'); + return *pChar != sal_Unicode('\0'); } } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 7ab9f024d4db..54e30e48c0d6 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -262,7 +262,7 @@ void SmSymbolManager::Load() SmLocalizedSymbolData aLocalizedData; const OUString aGreekSymbolSetName(aLocalizedData.GetUiSymbolSetName(OUString("Greek"))); const SymbolPtrVec_t aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) ); - String aSymbolSetName = OUString('i'); + OUString aSymbolSetName('i'); aSymbolSetName += aGreekSymbolSetName; size_t nSymbols = aGreekSymbols.size(); for (size_t i = 0; i < nSymbols; ++i) @@ -272,7 +272,7 @@ void SmSymbolManager::Load() Font aFont( rSym.GetFace() ); OSL_ENSURE( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." ); aFont.SetItalic( ITALIC_NORMAL ); - String aSymbolName = OUString('i'); + OUString aSymbolName('i'); aSymbolName += rSym.GetName(); SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(), aSymbolSetName, true /*bIsPredefined*/ ); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 2f7e0a7a4baf..1450ed5af83c 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -459,7 +459,7 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt) else { SmNode *pTree = (SmNode*)pViewShell->GetDoc()->GetFormulaTree(); std::fstream file("/tmp/smath-dump.gv", std::fstream::out); - String label(pViewShell->GetDoc()->GetText()); + OUString label(pViewShell->GetDoc()->GetText()); pTree->DumpAsDot(file, &label); file.close(); } @@ -1017,7 +1017,6 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::GetTextLineSize" ); - String aText; Size aSize(rDevice.GetTextWidth(rLine), rDevice.GetTextHeight()); sal_uInt16 nTabs = comphelper::string::getTokenCount(rLine, '\t'); @@ -1032,7 +1031,7 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) if (i > 0) aSize.Width() = ((aSize.Width() / TabPos) + 1) * TabPos; - aText = rLine.GetToken(i, '\t'); + OUString aText = rLine.GetToken(i, '\t'); aText = comphelper::string::stripStart(aText, '\t'); aText = comphelper::string::stripEnd(aText, '\t'); aSize.Width() += rDevice.GetTextWidth(aText); @@ -1048,14 +1047,12 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::GetTextSize" ); Size aSize; - String aLine; Size TextSize; - String aText; sal_uInt16 nLines = comphelper::string::getTokenCount(rText, '\n'); for (sal_uInt16 i = 0; i < nLines; i++) { - aLine = rText.GetToken(i, '\n'); + OUString aLine = rText.GetToken(i, '\n'); aLine = comphelper::string::remove(aLine, '\r'); aLine = comphelper::string::stripStart(aLine, '\n'); aLine = comphelper::string::stripEnd(aLine, '\n'); @@ -1066,15 +1063,16 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M { do { - xub_StrLen m = aLine.Len(); - xub_StrLen nLen = m; + OUString aText; + sal_Int32 m = aLine.getLength(); + sal_Int32 nLen = m; - for (xub_StrLen n = 0; n < nLen; n++) + for (sal_Int32 n = 0; n < nLen; n++) { - sal_Unicode cLineChar = aLine.GetChar(n); + sal_Unicode cLineChar = aLine[n]; if ((cLineChar == ' ') || (cLineChar == '\t')) { - aText = aLine.Copy(0, n); + aText = aLine.copy(0, n); if (GetTextLineSize(rDevice, aText).Width() < MaxWidth) m = n; else @@ -1082,8 +1080,8 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M } } - aText = aLine.Copy(0, m); - aLine.Erase(0, m); + aText = aLine.copy(0, m); + aLine = aLine.replaceAt(0, m, ""); aSize = GetTextLineSize(rDevice, aText); TextSize.Height() += aSize.Height(); TextSize.Width() = Max(TextSize.Width(), Min(aSize.Width(), MaxWidth)); @@ -1092,7 +1090,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M aLine = comphelper::string::stripStart(aLine, '\t'); aLine = comphelper::string::stripStart(aLine, ' '); } - while (aLine.Len() > 0); + while (!aLine.isEmpty()); } else { @@ -1109,7 +1107,6 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::DrawTextLine" ); - String aText; Point aPoint (rPosition); sal_uInt16 nTabs = comphelper::string::getTokenCount(rLine, '\t'); @@ -1122,7 +1119,7 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co if (i > 0) aPoint.X() = ((aPoint.X() / TabPos) + 1) * TabPos; - aText = rLine.GetToken(i, '\t'); + OUString aText = rLine.GetToken(i, '\t'); aText = comphelper::string::stripStart(aText, '\t'); aText = comphelper::string::stripEnd(aText, '\t'); rDevice.DrawText(aPoint, aText); @@ -1141,12 +1138,10 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const sal_uInt16 nLines = comphelper::string::getTokenCount(rText, '\n'); Point aPoint (rPosition); Size aSize; - String aLine; - String aText; for (sal_uInt16 i = 0; i < nLines; i++) { - aLine = rText.GetToken(i, '\n'); + OUString aLine = rText.GetToken(i, '\n'); aLine = comphelper::string::remove(aLine, '\r'); aLine = comphelper::string::stripEnd(aLine, '\n'); aLine = comphelper::string::stripEnd(aLine, '\n'); @@ -1155,23 +1150,24 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const { do { - xub_StrLen m = aLine.Len(); - xub_StrLen nLen = m; + OUString aText; + sal_Int32 m = aLine.getLength(); + sal_Int32 nLen = m; - for (xub_StrLen n = 0; n < nLen; n++) + for (sal_Int32 n = 0; n < nLen; n++) { - sal_Unicode cLineChar = aLine.GetChar(n); + sal_Unicode cLineChar = aLine[n]; if ((cLineChar == ' ') || (cLineChar == '\t')) { - aText = aLine.Copy(0, n); + aText = aLine.copy(0, n); if (GetTextLineSize(rDevice, aText).Width() < MaxWidth) m = n; else break; } } - aText = aLine.Copy(0, m); - aLine.Erase(0, m); + aText = aLine.copy(0, m); + aLine = aLine.replaceAt(0, m, ""); DrawTextLine(rDevice, aPoint, aText); aPoint.Y() += aSize.Height(); @@ -1183,7 +1179,7 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const while (GetTextLineSize(rDevice, aLine).Width() > MaxWidth); // print the remaining text - if (aLine.Len() > 0) + if (!aLine.isEmpty()) { DrawTextLine(rDevice, aPoint, aLine); aPoint.Y() += aSize.Height(); @@ -1414,11 +1410,11 @@ SmEditWindow *SmViewShell::GetEditWindow() } -void SmViewShell::SetStatusText(const String& Text) +void SmViewShell::SetStatusText(const OUString& rText) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SetStatusText" ); - StatusText = Text; + aStatusText = rText; GetViewFrame()->GetBindings().Invalidate(SID_TEXTSTATUS); } @@ -1513,8 +1509,8 @@ bool SmViewShell::InsertFrom(SfxMedium &rMedium) if (pStream) { - const String& rFltName = rMedium.GetFilter()->GetFilterName(); - if ( rFltName.EqualsAscii(MATHML_XML) ) + const OUString& rFltName = rMedium.GetFilter()->GetFilterName(); + if ( rFltName == MATHML_XML ) { Reference<com::sun::star::frame::XModel> xModel( pDoc->GetModel() ); SmXMLImportWrapper aEquation(xModel); //!! modifies the result of pDoc->GetText() !! @@ -1576,7 +1572,7 @@ void SmViewShell::Execute(SfxRequest& rReq) if (pWin) { GetDoc()->SetText( pWin->GetText() ); - SetStatusText(String()); + SetStatusText(OUString()); ShowError( 0 ); GetDoc()->Repaint(); } @@ -1643,7 +1639,7 @@ void SmViewShell::Execute(SfxRequest& rReq) uno::Reference < embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromInputStream( xStrm, ::comphelper::getProcessServiceFactory() ); uno::Reference < beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY ); - SfxMedium aMedium( xStorage, String() ); + SfxMedium aMedium( xStorage, OUString() ); Insert( aMedium ); GetDoc()->UpdateText(); } @@ -1935,7 +1931,7 @@ void SmViewShell::GetState(SfxItemSet &rSet) case SID_TEXTSTATUS: { - rSet.Put(SfxStringItem(nWh, StatusText)); + rSet.Put(SfxStringItem(nWh, aStatusText)); } break; @@ -1970,7 +1966,7 @@ SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *): { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SmViewShell" ); - SetStatusText(String()); + SetStatusText(OUString()); SetWindow(&aGraphic); SfxShell::SetName(rtl::OUString("SmView")); SfxShell::SetUndoManager( &GetDoc()->GetEditEngine().GetUndoManager() ); diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml index 2e20f6dc60aa..8a4d7c989737 100644 --- a/starmath/uiconfig/smath/menubar/menubar.xml +++ b/starmath/uiconfig/smath/menubar/menubar.xml @@ -29,6 +29,11 @@ <menu:menuitem menu:id=".uno:Save"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/starmath/uiconfig/smath/ui/printeroptions.ui b/starmath/uiconfig/smath/ui/printeroptions.ui index 9d818269f463..8bd161a378f7 100644 --- a/starmath/uiconfig/smath/ui/printeroptions.ui +++ b/starmath/uiconfig/smath/ui/printeroptions.ui @@ -83,7 +83,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Contents</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -195,8 +197,10 @@ <object class="GtkLabel" id="label5"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Soze</property> - <property name="use_markup">True</property> + <property name="label" translatable="yes">Size</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> |