diff options
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/document.cxx | 9 | ||||
-rw-r--r-- | starmath/source/makefile.mk | 3 | ||||
-rw-r--r-- | starmath/source/menu_tmpl.src | 160 | ||||
-rwxr-xr-x | starmath/source/node.cxx | 67 | ||||
-rwxr-xr-x | starmath/source/parse.cxx | 27 | ||||
-rw-r--r-- | starmath/source/smdetect.cxx | 16 | ||||
-rw-r--r-- | starmath/source/smres.src | 3 | ||||
-rwxr-xr-x | starmath/source/unomodel.cxx | 21 | ||||
-rwxr-xr-x | starmath/source/view.cxx | 4 |
9 files changed, 101 insertions, 209 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index ab1382b97879..243e16fb6504 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -38,6 +38,8 @@ #include <comphelper/storagehelper.hxx> #include <rtl/logfile.hxx> #include <rtl/ustring.hxx> +#include <unotools/eventcfg.hxx> +#include <sfx2/event.hxx> #include <sfx2/app.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/docfile.hxx> @@ -180,7 +182,14 @@ void SmDocShell::SetText(const String& rBuffer) { pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_TEXT); if ( SFX_CREATE_MODE_EMBEDDED == GetCreateMode() ) + { + // have SwOleClient::FormatChanged() to align the modified formula properly + // even if the vis area does not change (e.g. when formula text changes from + // "{a over b + c} over d" to "d over {a over b + c}" + SFX_APP()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this)); + Repaint(); + } else pViewSh->GetGraphicWindow().Invalidate(); } diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk index 0e038bb9c78d..5900fae65b87 100644 --- a/starmath/source/makefile.mk +++ b/starmath/source/makefile.mk @@ -95,9 +95,6 @@ LIB1OBJFILES = \ # --- Targets ------------------------------------------------------- -LOCALIZE_ME = menu_tmpl.src - - .INCLUDE : target.mk $(INCCOM)$/dllname.hxx: makefile.mk diff --git a/starmath/source/menu_tmpl.src b/starmath/source/menu_tmpl.src deleted file mode 100644 index c6eeeb60b7cd..000000000000 --- a/starmath/source/menu_tmpl.src +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _SFX_HRC //autogen -#include <sfx2/sfx.hrc> -#endif -#ifndef _GLOBLMN_HRC //autogen -#include <svx/globlmn.hrc> -#endif -#ifndef _GLOBALACC_SRC //autogen -#include <svx/globlac.hrc> -#endif -#ifndef _SVX_SVXIDS_HRC //autogen -#include <svx/svxids.hrc> -#endif - -#ifndef _STARMATH_HRC -#include "starmath.hrc" -#endif - -#ifndef MN_HELP -#define MN_HELP -#endif - -///////////////////////////////////////////////////////////////// - -/* - -The application menu bar resource has become obsolete. You can now find the menu bar definition at: -<project>/smath/menubar/menubar.xml. - -*/ - -///////////////////////////////////////////////////////////////// - -Accelerator RID_SMACCEL -{ - ItemList = - { - AI_UNDO - AI_REDO - AcceleratorItem - { - Identifier = SID_SELECT ; - Key = KeyCode - { - Code = KEY_A ; - Modifier1 = TRUE ; - }; - }; - AcceleratorItem - { - Identifier = SID_NEXTMARK ; - Key = KeyCode - { - Code = KEY_F4 ; - }; - }; - AcceleratorItem - { - Identifier = SID_PREVMARK ; - Key = KeyCode - { - Code = KEY_F4 ; - Shift = TRUE ; - }; - }; - AcceleratorItem - { - Identifier = SID_NEXTERR ; - Key = KeyCode - { - Code = KEY_F3 ; - }; - }; - AcceleratorItem - { - Identifier = SID_PREVERR ; - Key = KeyCode - { - Code = KEY_F3 ; - Shift = TRUE ; - }; - }; - AcceleratorItem - { - Identifier = SID_DRAW ; - Key = KeyCode - { - Code = KEY_F9 ; - }; - }; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index d8e2586e151e..b1d7d9e69210 100755 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -573,6 +573,13 @@ const SmNode * SmNode::FindNodeWithAccessibleIndex(xub_StrLen nAccIdx) const return pResult; } + +long SmNode::GetFormulaBaseline() const +{ + DBG_ASSERT( 0, "This dummy implementation should not have been called." ); + return 0; +} + /////////////////////////////////////////////////////////////////////////// SmStructureNode::SmStructureNode( const SmStructureNode &rNode ) : @@ -763,7 +770,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) } Point aPos; - SmRect::operator = (SmRect(nMaxWidth, 0)); + SmRect::operator = (SmRect(nMaxWidth, 1)); for (i = 0; i < nSize; i++) { if (NULL != (pNode = GetSubNode(i))) { const SmRect &rNodeRect = pNode->GetRect(); @@ -779,6 +786,22 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) ExtendBy(rNodeRect, nSize > 1 ? RCP_NONE : RCP_ARG); } } + // --> 4.7.2010 #i972# + if (HasBaseline()) + nFormulaBaseline = GetBaseline(); + else + { + SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); + aTmpDev.SetFont(GetFont()); + + SmRect aRect = (SmRect(aTmpDev, &rFormat, C2S("a"), + GetFont().GetBorderWidth())); + nFormulaBaseline = GetAlignM(); + // move from middle position by constant - distance + // between middle and baseline for single letter + nFormulaBaseline += aRect.GetBaseline() - aRect.GetAlignM(); + } + // <-- } @@ -788,6 +811,12 @@ SmNode * SmTableNode::GetLeftMost() } +long SmTableNode::GetFormulaBaseline() const +{ + return nFormulaBaseline; +} + + /**************************************************************************/ @@ -818,20 +847,21 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmTmpDevice aTmpDev ((OutputDevice &) rDev, TRUE); aTmpDev.SetFont(GetFont()); - // provide an empty rectangle with alignment parameters for the "current" - // font (in order to make "a^1 {}_2^3 a_4" work correct, that is, have the - // same sub-/supscript positions.) - //! be sure to use a character that has explicitly defined HiAttribut - //! line in rect.cxx such as 'a' in order to make 'vec a' look same to - //! 'vec {a}'. - SmRect::operator = (SmRect(aTmpDev, &rFormat, C2S("a"), - GetFont().GetBorderWidth())); - // make sure that the rectangle occupies (almost) no space - SetWidth(1); - SetItalicSpaces(0, 0); - if (nSize < 1) + { + // provide an empty rectangle with alignment parameters for the "current" + // font (in order to make "a^1 {}_2^3 a_4" work correct, that is, have the + // same sub-/supscript positions.) + //! be sure to use a character that has explicitly defined HiAttribut + //! line in rect.cxx such as 'a' in order to make 'vec a' look same to + //! 'vec {a}'. + SmRect::operator = (SmRect(aTmpDev, &rFormat, C2S("a"), + GetFont().GetBorderWidth())); + // make sure that the rectangle occupies (almost) no space + SetWidth(1); + SetItalicSpaces(0, 0); return; + } // make distance depend on font size long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetSize().Height()) / 100L; @@ -839,14 +869,17 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) nDist = 0; Point aPos; - for (i = 0; i < nSize; i++) + // copy the first node into LineNode and extend by the others + if (NULL != (pNode = GetSubNode(0))) + SmRect::operator = (pNode->GetRect()); + + for (i = 1; i < nSize; i++) if (NULL != (pNode = GetSubNode(i))) { aPos = pNode->AlignTo(*this, RP_RIGHT, RHA_CENTER, RVA_BASELINE); - // no horizontal space before first node - if (i) - aPos.X() += nDist; + // add horizontal space to the left for each but the first sub node + aPos.X() += nDist; pNode->MoveTo(aPos); ExtendBy( *pNode, RCP_XOR ); diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index d12f3df07400..697e18362d87 100755 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2317,18 +2317,23 @@ void SmParser::Special() // conversion of symbol names for 6.0 (XML) file format // (name change on import / export. // UI uses localized names XML file format does not.) - if (IsImportSymbolNames()) + if( rName.Len() && rName.GetChar( 0 ) == sal_Unicode( '%' ) ) { - const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData(); - aNewName = rLSD.GetUiSymbolName( rName ); - bReplace = TRUE; - } - else if (IsExportSymbolNames()) - { - const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData(); - aNewName = rLSD.GetExportSymbolName( rName ); - bReplace = TRUE; + if (IsImportSymbolNames()) + { + const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData(); + aNewName = rLSD.GetUiSymbolName( rName.Copy( 1 ) ); + bReplace = TRUE; + } + else if (IsExportSymbolNames()) + { + const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData(); + aNewName = rLSD.GetExportSymbolName( rName.Copy( 1 ) ); + bReplace = TRUE; + } } + if( aNewName.Len() ) + aNewName.Insert( '%', 0 ); } else // 5.0 <-> 6.0 formula text (symbol name) conversion { @@ -2367,7 +2372,7 @@ void SmParser::Special() if (bReplace && aNewName.Len() && rName != aNewName) { - Replace( GetTokenIndex() + 1, rName.Len(), aNewName ); + Replace( GetTokenIndex(), rName.Len(), aNewName ); rName = aNewName; } diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 583098b6d8a2..6986864f6e80 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -30,7 +30,7 @@ #include "smdetect.hxx" -#include <framework/interaction.hxx> +//#include <framework/interaction.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -274,20 +274,16 @@ SmFilterDetect::~SmFilterDetect() if ( !bRepairPackage ) { // ask the user whether he wants to try to repair - RequestPackageReparation* pRequest = new RequestPackageReparation( aDocumentTitle ); - uno::Reference< task::XInteractionRequest > xRequest ( pRequest ); - - xInteraction->handle( xRequest ); - - bRepairAllowed = pRequest->isApproved(); + RequestPackageReparation aRequest( aDocumentTitle ); + xInteraction->handle( aRequest.GetRequest() ); + bRepairAllowed = aRequest.isApproved(); } if ( !bRepairAllowed ) { // repair either not allowed or not successful - NotifyBrokenPackage* pNotifyRequest = new NotifyBrokenPackage( aDocumentTitle ); - uno::Reference< task::XInteractionRequest > xRequest ( pNotifyRequest ); - xInteraction->handle( xRequest ); + NotifyBrokenPackage aNotifyRequest( aDocumentTitle ); + xInteraction->handle( aNotifyRequest.GetRequest() ); } } diff --git a/starmath/source/smres.src b/starmath/source/smres.src index e608b1c9108d..bef6d0bec106 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -1767,9 +1767,6 @@ StringArray RID_PRINTUIOPTIONS < "Adjusts the formula to the page format used in the printout."; >; < "~Scaling"; >; < "Reduces or enlarges the size of the printed formula by a specified enlargement factor."; >; -// < "Miscellaneous options"; >; -// < "Ig~nore ~~ and ` at the end of the line"; >; -// < "Specfies that these space wildcards will be removed if they are at the end of a line."; >; }; }; diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index cd3e4b714469..108cb9c69e4a 100755 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -238,7 +238,8 @@ enum SmModelPropertyHandles // --> PB 2004-08-25 #i33095# Security Options HANDLE_LOAD_READONLY, // <-- - HANDLE_DIALOG_LIBRARIES // #i73329# + HANDLE_DIALOG_LIBRARIES, // #i73329# + HANDLE_BASELINE // 3.7.2010 #i972# }; PropertySetInfo * lcl_createModelPropertyInfo () @@ -310,6 +311,9 @@ PropertySetInfo * lcl_createModelPropertyInfo () // --> PB 2004-08-25 #i33095# Security Options { RTL_CONSTASCII_STRINGPARAM( "LoadReadonly" ), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), PROPERTY_NONE, 0 }, // <-- + // --> 3.7.2010 #i972# + { RTL_CONSTASCII_STRINGPARAM( "BaseLine"), HANDLE_BASELINE, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, 0}, + // <-- { NULL, 0, 0, NULL, 0, 0 } }; PropertySetInfo *pInfo = new PropertySetInfo ( aModelPropertyInfoMap ); @@ -955,6 +959,21 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu break; } // <-- + // --> 3.7.2010 #i972# + case HANDLE_BASELINE: + { + if ( !pDocSh->pTree ) + pDocSh->Parse(); + if ( pDocSh->pTree ) + { + if ( !pDocSh->IsFormulaArranged() ) + pDocSh->ArrangeFormula(); + + *pValue <<= static_cast<sal_Int32>( pDocSh->pTree->GetFormulaBaseline() ); + } + } + break; + // <-- } } } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 20c235408013..748e62e3536e 100755 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -738,10 +738,6 @@ SFX_IMPL_INTERFACE(SmViewShell, SfxViewShell, SmResId(0)) SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER, SmResId(RID_MATH_TOOLBOX )); - //Dummy-Objectbar, damit es bei aktivieren nicht staendig zuppelt. -// Wegen #58705# entfernt (RID wurde nirgends verwendet) -// SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_SERVER, -// SmResId(RID_DRAW_OBJECTBAR) ); SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE); SFX_CHILDWINDOW_REGISTRATION(SmToolBoxWrapper::GetChildWindowId()); |