Commits

Anonymous committed 4b75096 Merge

CWS-TOOLING: integrate CWS tl83_OOO330

Comments (0)

Files changed (24)

editeng/source/editeng/impedit4.cxx

 
 SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs )
 {
-	pSpellInfo = new SpellInfo;
+    if (!pSpellInfo)
+	    pSpellInfo = new SpellInfo;
+    else
+        *pSpellInfo = SpellInfo();  // reset to default values
+
 	pSpellInfo->bMultipleDoc = bMultipleDocs;
     EditSelection aSentenceSel( SelectSentence( rSel ) );
 //    pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() );
 #else
     bool bRet = false;
     EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() );
-    //the pSpellInfo has to be created on demand
     if(!pSpellInfo)
 		pSpellInfo = CreateSpellInfo( aCurSel, true );
     pSpellInfo->aCurSentenceStart = aCurSel.Min();
 {
 #ifdef SVX_LIGHT
 #else
+    // Note: rNewPortions.size() == 0 is valid and happens when the whole
+    // sentence got removed in the dialog
+
     DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized");
-    if(pSpellInfo)
+    if (pSpellInfo &&
+        pSpellInfo->aLastSpellPortions.size() > 0)  // no portions -> no text to be changed
     {
         // get current paragraph length to calculate later on how the sentence length changed,
         // in order to place the cursor at the end of the sentence again
         UndoActionStart( EDITUNDO_INSERT );
         if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size())
         {
+            DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
+            DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(),
+                    "aLastSpellPortions and aLastSpellContentSelections size mismatch" );
+
             //the simple case: the same number of elements on both sides
             //each changed element has to be applied to the corresponding source element
             svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
         }
         else
         {
+            DBG_ASSERT( pSpellInfo->aLastSpellContentSelections.size() > 0, "aLastSpellContentSelections should not be empty here" );
+
             //select the complete sentence
             SpellContentSelections::const_iterator aCurrentEndPosition = pSpellInfo->aLastSpellContentSelections.end();
             --aCurrentEndPosition;
Add a comment to this file

extras/source/wordbook/standard.dic

File contents unchanged.

helpcontent2/source/text/shared/01/01100600.xhp

   <embed href="text/shared/00/00000401.xhp#infosec"/>
 </section>
 
+<comment>
 <paragraph role="heading" id="hd_id31499" xml-lang="en-US" level="2" l10n="NEW">File encryption</paragraph>
 <paragraph role="paragraph" id="hd_id31499A" xml-lang="en-US" l10n="NEW">The password to open the current document can be set in the Properties dialog on the Security tab page. You can also set a password to open the document when you save the document. Check the Save with password option on the Save As dialog, and enter the password.</paragraph>
 <bookmark xml-lang="en-US" branch="hid/HID_SECURITYTAB_PASSWORD_TO_OPEN" id="bm_id8295846C" localize="false"/>
 <bookmark xml-lang="en-US" branch="hid/HID_SECURITYTAB_CONFIRM_PASSWORD_TO_MODIFY" id="bm_id8295846I" localize="false"/>
 <paragraph role="heading" id="par_idN106AA4" xml-lang="en-US" level="3" l10n="NEW">Confirm password</paragraph>
 <paragraph xml-lang="en-US" id="par_id3151100J" role="paragraph" l10n="NEW"><ahelp hid=".">Re-enter the password.</ahelp></paragraph>
+</comment>
 
 <bookmark xml-lang="en-US" branch="hid/HID_SECURITYTAB_OPEN_FILE_READONLY" id="bm_id8295846" localize="false"/>
 <paragraph role="heading" id="par_idN106AA" xml-lang="en-US" level="3" l10n="NEW">Open file read-only</paragraph>

officecfg/registry/data/org/openoffice/Office/Math.xcu

         <value>0</value>
       </prop>
     </node>
+
+    <!-- only used for symbols with the 'Greek' symbol set name -->
     <node oor:name="Id2" oor:op="replace">
       <prop oor:name="Name">
         <value>OpenSymbol</value>
         <value>0</value>
       </prop>
       <prop oor:name="Italic">
-        <value>2</value>
+        <value>0</value>
       </prop>
     </node>
   </node>
+
   <node oor:name="SymbolList">
     <node oor:name="alpha" oor:op="replace">
       <prop oor:name="Char">

officecfg/registry/schema/org/openoffice/Office/Math.xcs

 				</info>
 				<value>false</value>
 			</prop>
-			<prop oor:name="ScaleNormalBracket" oor:type="xs:boolean">
+            <prop oor:name="GreekCharStyle" oor:type="xs:short">
+                <!-- UIHints: n/a yet -->
+                <info>
+                    <author>TL</author>
+                    <desc>Specifies the default layout for symbols from the 'Greek' symbol set.</desc>
+                    <label>Greek character style</label>
+                </info>
+                <constraints>
+                    <minInclusive oor:value="0">
+                        <info>
+                            <desc>Specifies the minimum value allowed</desc>
+                        </info>
+                    </minInclusive>
+                    <maxInclusive oor:value="2">
+                        <info>
+                            <desc>Specifies the maximum value allowed</desc>
+                        </info>
+                    </maxInclusive>
+                </constraints>
+                <value>0</value>
+            </prop>
+            <prop oor:name="ScaleNormalBracket" oor:type="xs:boolean">
 				<!-- OldPath: Math/StandardFormat -->
 				<!-- OldLocation: Soffice.cfg -->
 				<!-- UIHints: Format - Spacing - Category - Brackets - Scale all brackets -->

sfx2/source/dialog/securitypage.cxx

     m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE );
     m_aRecordChangesCB.SetToggleHdl( LINK( this, SfxSecurityPage_Impl, RecordChangesCBToggleHdl ) );
     m_aChangeProtectionPB.SetClickHdl( LINK( this, SfxSecurityPage_Impl, ChangeProtectionPBHdl ) );
+
+
+    // #i112277: for the time being (OOO 3.3) the following options should not
+    // be available. In the long run however it is planned to implement the yet
+    // missing functionality. Thus now we hide them and move the remaining ones up.
+    m_aNewPasswordToOpenFL.Hide();
+    m_aNewPasswordToOpenFT.Hide();
+    m_aNewPasswordToOpenED.Hide();
+    m_aConfirmPasswordToOpenFT.Hide();
+    m_aConfirmPasswordToOpenED.Hide();
+    m_aNewPasswordInfoFT.Hide();
+    m_aNewPasswordToModifyFL.Hide();
+    m_aNewPasswordToModifyFT.Hide();
+    m_aNewPasswordToModifyED.Hide();
+    m_aConfirmPasswordToModifyFT.Hide();
+    m_aConfirmPasswordToModifyED.Hide();
+    const long nDelta = m_aOptionsFL.GetPosPixel().Y() - m_aNewPasswordToOpenFL.GetPosPixel().Y();
+    Point aPos;
+    aPos = m_aOptionsFL.GetPosPixel();
+    aPos.Y() -= nDelta;
+    m_aOptionsFL.SetPosPixel( aPos );
+    aPos = m_aOpenReadonlyCB.GetPosPixel();
+    aPos.Y() -= nDelta;
+    m_aOpenReadonlyCB.SetPosPixel( aPos );
+    aPos = m_aRecordChangesCB.GetPosPixel();
+    aPos.Y() -= nDelta;
+    m_aRecordChangesCB.SetPosPixel( aPos );
+    aPos = m_aChangeProtectionPB.GetPosPixel();
+    aPos.Y() -= nDelta;
+    m_aChangeProtectionPB.SetPosPixel( aPos );
 }
 
     

starmath/inc/format.hxx

 	USHORT		vSize[SIZ_END + 1];
 	USHORT		vDist[DIS_END + 1];
 	SmHorAlign	eHorAlign;
+    INT16       nGreekCharStyle;
 	BOOL		bIsTextmode,
 				bScaleNormalBrackets;
 
 
 	BOOL			IsTextmode() const     { return bIsTextmode; }
 	void			SetTextmode(BOOL bVal) { bIsTextmode = bVal; }
+    
+    INT16           GetGreekCharStyle() const     { return nGreekCharStyle; }
+    void            SetGreekCharStyle(INT16 nVal) { nGreekCharStyle = nVal; }
 
 	BOOL			IsScaleNormalBrackets() const     { return bScaleNormalBrackets; }
 	void			SetScaleNormalBrackets(BOOL bVal) { bScaleNormalBrackets = bVal; }

starmath/inc/node.hxx

     USHORT      nFontDesc;
 
 protected:
-	SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP)
-	:	SmVisibleNode(eNodeType, rNodeToken)
-	{
-        nFontDesc = nFontDescP;
-	}
+	SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP );
 
 public:
-	SmTextNode(const SmToken &rNodeToken, USHORT nFontDescP)
-	:	SmVisibleNode(NTEXT, rNodeToken)
-	{
-		nFontDesc = nFontDescP;
-	}
-
+	SmTextNode(const SmToken &rNodeToken, USHORT nFontDescP );
 
 	USHORT				GetFontDesc() const { return nFontDesc; }
 	void				SetText(const XubString &rText) { aText = rText; }
 
 class SmSpecialNode : public SmTextNode
 {
+    bool    bIsFromGreekSymbolSet;
+
 protected:
-    SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc)
-    :   SmTextNode(eNodeType, rNodeToken, _nFontDesc)
-	{}
+    SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc);
 
 public:
-	SmSpecialNode(const SmToken &rNodeToken)
-	:	SmTextNode(NSPECIAL, rNodeToken, FNT_MATH)	//! default Font nicht immer richtig
-	{}
+	SmSpecialNode(const SmToken &rNodeToken);
 
 	virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
 	virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);

starmath/inc/symbol.hxx

 #include <map>
 #include <vector>
 #include <set>
+#include <functional>
+#include <algorithm>
 
+#include "unomodel.hxx"
 #include "utility.hxx"
 #include "smmod.hxx"
 
 // vector of pointers to the actual symbols in the above container
 typedef std::vector< const SmSym * >            SymbolPtrVec_t;
 
+struct lt_SmSymPtr : public std::binary_function< const SmSym *, const SmSym *, bool >
+{
+    bool operator() ( const SmSym *pSym1, const SmSym *pSym2 ) 
+    { 
+        return pSym1->GetCharacter() < pSym2->GetCharacter();
+    }
+};
+
+
 class SmSymbolManager : public SfxListener
 {
     SymbolMap_t         m_aSymbols;

starmath/source/cfgitem.cxx

 using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 
-#define A2OU(x)        rtl::OUString::createFromAscii( x )
 
 static const char* aRootName = "Office.Math";
 
 static const char * aFormatPropNames[] =
 {
     "StandardFormat/Textmode",
+    "StandardFormat/GreekCharStyle",
     "StandardFormat/ScaleNormalBracket",
     "StandardFormat/HorizontalAlignment",
     "StandardFormat/BaseSize",
         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
             pFormat->SetTextmode( bTmp );
         ++pVal;
+        // StandardFormat/GreekCharStyle
+        if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
+            pFormat->SetGreekCharStyle( nTmp16 );
+        ++pVal;
         // StandardFormat/ScaleNormalBracket
         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
             pFormat->SetScaleNormalBrackets( bTmp );
 
     // StandardFormat/Textmode
     *pValue++ <<= (BOOL) pFormat->IsTextmode();
+    // StandardFormat/GreekCharStyle
+    *pValue++ <<= (INT16) pFormat->GetGreekCharStyle();
     // StandardFormat/ScaleNormalBracket
     *pValue++ <<= (BOOL) pFormat->IsScaleNormalBrackets();
     // StandardFormat/HorizontalAlignment

starmath/source/dialog.cxx

 void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet)
 {
 	aSymbolSet = rSymbolSet;
-
+    
     if (static_cast< USHORT >(aSymbolSet.size()) > (nColumns * nRows))
 	{
         aVScrollBar.SetRange(Range(0, ((aSymbolSet.size() + (nColumns - 1)) / nColumns) - nRows));
 	{
 		XubString	aText ('%');
 		aText += pSym->GetName();
+		aText += (sal_Unicode)' ';
 
         rViewSh.GetViewFrame()->GetDispatcher()->Execute(
                 SID_INSERTTEXT, SFX_CALLMODE_STANDARD,
         aSymbolSetName  = rSymbolSetName;
         aSymbolSet      = rSymbolMgr.GetSymbolSet( aSymbolSetName );
 
+        // sort symbols by Unicode position (useful for displaying Greek characters alphabetically)
+        std::sort( aSymbolSet.begin(), aSymbolSet.end(), lt_SmSymPtr() );
+
         aSymbolSetDisplay.SetSymbolSet( aSymbolSet );
         if (aSymbolSet.size() > 0)
 			SelectSymbol(0);

starmath/source/document.cxx

 	{
 		case HINT_FORMATCHANGED:
 			SetFormulaArranged(FALSE);
-            nModifyCount++;     //! merkwuerdig...
-								// ohne dies wird die Grafik letztlich
-								// nicht geupdatet
+            
+            nModifyCount++;     //! see comment for SID_GAPHIC_SM in SmDocShell::GetState
+
             Repaint();
 			break;
 	}
     RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::SetFormat" );
 
 	aFormat = rFormat;
-	SetFormulaArranged(FALSE);
-	SmViewShell *pViewSh = SmGetActiveView();
-	if (pViewSh)
-        pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_GAPHIC_SM);
-	SetModified(TRUE);
+	SetFormulaArranged( FALSE );
+	SetModified( TRUE );
+
+    nModifyCount++;     //! see comment for SID_GAPHIC_SM in SmDocShell::GetState
+
+    // don't use SmGetActiveView since the view shell might not be active (0 pointer)
+    // if for example the Basic Macro dialog currently has the focus. Thus:
+	SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
+	while (pFrm)
+	{
+		pFrm->GetBindings().Invalidate(SID_GAPHIC_SM);
+		pFrm = SfxViewFrame::GetNext( *pFrm, this );
+	}
 }
 
 String SmDocShell::GetAccessibleText()
 		delete pTree;
     ReplaceBadChars();
 	pTree = aInterpreter.Parse(aText);
-	nModifyCount++;
+	nModifyCount++;     //! see comment for SID_GAPHIC_SM in SmDocShell::GetState
     SetFormulaArranged( FALSE );
 }
 
 
 		case SID_TEXT:
 		{
-			const SfxStringItem& rItem =
-				(const SfxStringItem&)rReq.GetArgs()->Get(SID_TEXT);
-
+			const SfxStringItem& rItem = (const SfxStringItem&)rReq.GetArgs()->Get(SID_TEXT);
 			if (GetText() != rItem.GetValue())
-			{
 				SetText(rItem.GetValue());
-			}
 		}
 		break;
 
 			break;
 
         case SID_GAPHIC_SM:
+            //! very old (pre UNO) and ugly hack to invalidate the SmGraphicWindow.
+            //! If nModifyCount gets changed then the call below will implicitly notify 
+            //! SmGraphicController::StateChanged and there the window gets invalidated.
+            //! Thus all the 'nModifyCount++' before invalidating this slot.
             rSet.Put(SfxInt16Item(SID_GAPHIC_SM, nModifyCount));
 			break;
 

starmath/source/edit.cxx

     SmModule *pp = SM_MOD();
 	if (pp->GetConfig()->IsAutoRedraw())
 		Flush();
+    aModifyTimer.Stop();
 	return 0;
 }
 
 			aOldSelection = aNewSelection;
 		}
 	}
+    aCursorMoveTimer.Stop();
 
 	return 0;
 }
             SmViewShell *pView = GetView();
             if ( pView && !pView->KeyInput(rKEvt) )
 			{
-					/* fuert bei F1 (Hilfe) zum Zerstoeren von this! */
+				/* fuert bei F1 (Hilfe) zum Zerstoeren von this! */
 				Flush();
 				if ( aModifyTimer.IsActive() )
 					aModifyTimer.Stop();
             pEditView->SetSelection(aSelection);
         }
 
+        aModifyTimer.Start();
+		aCursorMoveTimer.Start();
+
         GrabFocus();
     }
 }
 {
     DBG_ASSERT( pEditView, "EditView missing" );
     if (pEditView)
+    {
         pEditView->InsertText(Text);
+        aModifyTimer.Start();
+		aCursorMoveTimer.Start();
+    }
 }
 
 void SmEditWindow::Flush()
 		pEditEngine->ClearModifyFlag();
         SmViewShell *pViewSh = rCmdBox.GetView();
 		if (pViewSh)
+        {
 			pViewSh->GetViewFrame()->GetDispatcher()->Execute(
 					SID_TEXT, SFX_CALLMODE_STANDARD,
 					new SfxStringItem(SID_TEXT, GetText()), 0L);
+        }
 	}
 
 	if (aCursorMoveTimer.IsActive())

starmath/source/format.cxx

 {
 	nVersion 	= SM_FMT_VERSION_NOW;
 
-	eHorAlign   = AlignCenter;
-	bIsTextmode = bScaleNormalBrackets = FALSE;
+	eHorAlign       = AlignCenter;
+    nGreekCharStyle = 0;
+	bIsTextmode     = bScaleNormalBrackets = FALSE;
 
 	vSize[SIZ_TEXT] 	= 100;
 	vSize[SIZ_INDEX]	= 60;
 	SetVersion (rFormat.GetVersion());
 	SetHorAlign(rFormat.GetHorAlign());
 	SetTextmode(rFormat.IsTextmode());
+	SetGreekCharStyle(rFormat.GetGreekCharStyle());
 	SetScaleNormalBrackets(rFormat.IsScaleNormalBrackets());
 
 	USHORT  i;
 {
     BOOL bRes = aBaseSize == rFormat.aBaseSize  &&
                 eHorAlign == rFormat.eHorAlign  &&
+                nGreekCharStyle == rFormat.nGreekCharStyle &&
                 bIsTextmode == rFormat.bIsTextmode  &&
                 bScaleNormalBrackets  == rFormat.bScaleNormalBrackets;
 

starmath/source/makefile.mk

 
 # --- Settings -----------------------------------------------------
 
+ENABLE_EXCEPTIONS=TRUE
+
 .INCLUDE :  settings.mk
 
 # --- Files --------------------------------------------------------
 	$(SLO1FILES) \
 	$(SLO2FILES)
 
-EXCEPTIONSFILES =   \
-		$(SLO)$/register.obj  \
-        $(SLO)$/accessibility.obj \
-        $(SLO)$/cfgitem.obj \
-        $(SLO)$/dialog.obj \
-        $(SLO)$/document.obj \
-		$(SLO)$/node.obj \
-		$(SLO)$/parse.obj \
-        $(SLO)$/mathmlimport.obj \
-        $(SLO)$/mathmlexport.obj \
-        $(SLO)$/mathtype.obj \
-		$(SLO)$/smdll.obj \
-        $(SLO)$/view.obj \
-		$(SLO)$/unomodel.obj \
-		$(SLO)$/smdetect.obj \
-        $(SLO)$/symbol.obj \
-		$(SLO)$/unodoc.obj
-
 LIB1TARGET = \
 	$(SLB)$/$(TARGET).lib
 

starmath/source/mathmlexport.cxx

 #include <memory>
 
 #include "mathmlexport.hxx"
-#include "mathtype.hxx"
 #include <starmath.hrc>
 #include <unomodel.hxx>
 #include <document.hxx>

starmath/source/mathmlimport.cxx

 #include <memory>
 
 #include "mathmlimport.hxx"
-#include "mathtype.hxx"
 #include <starmath.hrc>
 #include <unomodel.hxx>
 #include <document.hxx>

starmath/source/node.cxx

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_starmath.hxx"
 
-#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii))
+#include "node.hxx"
+#include "rect.hxx"
+#include "symbol.hxx"
+#include "smmod.hxx"
+#include "document.hxx"
+#include "view.hxx"
+#include "mathtype.hxx"
+
 #include <tools/gen.hxx>
 #include <tools/fract.hxx>
 #include <rtl/math.hxx>
 #include <vcl/outdev.hxx>
 #include <sfx2/module.hxx>
 
-
-#include "node.hxx"
-#include <rect.hxx>
-#include "symbol.hxx"
-#include "smmod.hxx"
-#include <document.hxx>
-#include <view.hxx>
-#ifndef _MATHTYPE_HXX
-#include "mathtype.hxx"
-#endif
-
 #include <math.h>
 #include <float.h>
 
 // define this to draw rectangles for debugging
 //#define SM_RECT_DEBUG
 
+#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii))
+
 ////////////////////////////////////////
 // SmTmpDevice
 // Allows for font and color changes. The original settings will be restored
 /**************************************************************************/
 
 
+SmTextNode::SmTextNode( SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP ) :	
+    SmVisibleNode(eNodeType, rNodeToken)
+{
+    nFontDesc = nFontDescP;
+}
+
+
+SmTextNode::SmTextNode( const SmToken &rNodeToken, USHORT nFontDescP ) :
+    SmVisibleNode(NTEXT, rNodeToken)
+{
+	nFontDesc = nFontDescP;
+}
+
+
 void SmTextNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
 {
 	SmNode::Prepare(rFormat, rDocShell);
 
 /**************************************************************************/
 
+bool lcl_IsFromGreekSymbolSet( const String &rTokenText )
+{
+    bool bRes = false;
+
+    // valid symbol name needs to have a '%' at pos 0 and at least an additonal char
+    if (rTokenText.Len() > 2 && rTokenText.GetBuffer()[0] == (sal_Unicode)'%')
+    {
+        String aName( rTokenText.Copy(1) );
+        SmSym *pSymbol = SM_MOD()->GetSymbolManager().GetSymbolByName( aName );
+        if (pSymbol && GetExportSymbolSetName( pSymbol->GetSymbolSetName() ).EqualsAscii( "Greek" ) )
+            bRes = true;
+    }
+
+    return bRes;
+}
+
+
+SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc) :
+    SmTextNode(eNodeType, rNodeToken, _nFontDesc)
+{
+    bIsFromGreekSymbolSet = lcl_IsFromGreekSymbolSet( rNodeToken.aText );
+}
+
+
+SmSpecialNode::SmSpecialNode(const SmToken &rNodeToken) :
+    SmTextNode(NSPECIAL, rNodeToken, FNT_MATH)	//! default Font nicht immer richtig
+{
+    bIsFromGreekSymbolSet = lcl_IsFromGreekSymbolSet( rNodeToken.aText );
+}
+
 
 void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
 {
 	const SmSym	  *pSym;
     SmModule  *pp = SM_MOD();
 
-    if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName(GetToken().aText)))
+    String aName( GetToken().aText.Copy(1) );
+    if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName( aName )))
     {
         SetText( pSym->GetCharacter() );
 		GetFont() = pSym->GetFace();
 		SetAttribut(ATTR_BOLD);
 
 	Flags() |= FLG_FONT;
+
+    if (bIsFromGreekSymbolSet)
+    {
+        DBG_ASSERT( GetText().Len() == 1, "a symbol should only consist of 1 char!" );
+        bool bItalic = false;
+        INT16 nStyle = rFormat.GetGreekCharStyle();
+        DBG_ASSERT( nStyle >= 0 && nStyle <= 2, "unexpected value for GreekCharStyle" );
+        if (nStyle == 1)
+            bItalic = true;
+        else if (nStyle == 2)
+        {
+            String aTmp( GetText() );
+            if (aTmp.Len() > 0)
+            {
+                const sal_Unicode cUppercaseAlpha = 0x0391;
+                const sal_Unicode cUppercaseOmega = 0x03A9;
+                sal_Unicode cChar = aTmp.GetBuffer()[0];
+                // uppercase letters should be straight and lowercase letters italic
+                bItalic = !(cUppercaseAlpha <= cChar && cChar <= cUppercaseOmega);
+            }
+        }
+
+        if (bItalic)
+            Attributes() |= ATTR_ITALIC;
+        else
+            Attributes() &= ~ATTR_ITALIC;;
+    }
 };
 
 

starmath/source/parse.cxx

                         CurToken.nLevel     = 5;
                         CurToken.aText      = String();
                         CurToken.nRow       = sal::static_int_cast< xub_StrLen >(Row);
-                        CurToken.nCol       = nTmpStart - ColOff + 1;
+                        CurToken.nCol       = nTmpStart - ColOff;
 
                         if (aTmpRes.TokenType & KParseType::IDENTNAME)
                         {
 
                             xub_StrLen n = sal::static_int_cast< xub_StrLen >(aTmpRes.EndPos - nTmpStart);
                             CurToken.eType      = TSPECIAL;
-                            CurToken.aText      = BufferString.Copy( sal::static_int_cast< xub_StrLen >(nTmpStart), n );
+                            CurToken.aText      = BufferString.Copy( sal::static_int_cast< xub_StrLen >(nTmpStart-1), n+1 );
 
                             DBG_ASSERT( aTmpRes.EndPos > rnEndPos,
                                     "empty identifier" );

starmath/source/symbol.cxx

         DBG_ERROR( "no symbol set found" );
         m_bModified = false;
     }
+
+    // now add a %i... symbol to the 'iGreek' set for every symbol found in the 'Greek' set.
+    SmLocalizedSymbolData   aLocalizedData;
+    const String aGreekSymbolSetName( aLocalizedData.GetUiSymbolSetName( A2OU("Greek") ) );
+    const SymbolPtrVec_t    aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) );
+    String aSymbolSetName( (sal_Unicode) 'i' );
+    aSymbolSetName += aGreekSymbolSetName;
+    size_t nSymbols = aGreekSymbols.size();
+    for (size_t i = 0;  i < nSymbols;  ++i)
+    {
+        // make the new symbol a copy but with ITALIC_NORMAL, and add it to iGreek
+        const SmSym &rSym = *aGreekSymbols[i];
+        Font aFont( rSym.GetFace() );
+        DBG_ASSERT( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." );
+        aFont.SetItalic( ITALIC_NORMAL );
+        String aSymbolName( (sal_Unicode)'i' );
+        aSymbolName += rSym.GetName();
+        SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(),
+		        aSymbolSetName, TRUE /*bIsPredefined*/ );
+
+        AddOrReplaceSymbol( aSymbol );
+    }
 }
 
 void SmSymbolManager::Save()
         }
         DBG_ASSERT(pSym - pSymbols == nSaveSymbolCnt, "wrong number of symbols" );
 #endif        
+
+        // prepare to skip symbols from iGreek on saving
+        SmLocalizedSymbolData   aLocalizedData;
+        String aSymbolSetName( (sal_Unicode) 'i' );
+        aSymbolSetName += aLocalizedData.GetUiSymbolSetName( A2OU("Greek") );
+
         SymbolPtrVec_t aTmp( GetSymbols() );
         std::vector< SmSym > aSymbols;
         for (size_t i = 0; i < aTmp.size(); ++i)
-            aSymbols.push_back( *aTmp[i] );
+        {
+            // skip symbols from iGreek set since those symbols always get added
+            // by computational means in SmSymbolManager::Load
+            if (aTmp[i]->GetSymbolSetName() != aSymbolSetName)
+                aSymbols.push_back( *aTmp[i] );
+        }
         rCfg.SetSymbols( aSymbols );
 #if 0        
         delete [] pSymbols;

starmath/source/types.cxx

     if (IsInPrivateUseArea( cChar ))
     {
         DBG_ASSERT( 0, "Error: private use area characters should no longer be in use!" );
-        cRes = (sal_Unicode) '&'; // just some character that should easily be notice as odd in the context
+        cRes = (sal_Unicode) '@'; // just some character that should easily be notice as odd in the context
     }
     return cRes;
 }

starmath/source/unomodel.cxx

 	HANDLE_RELATIVE_FONT_HEIGHT_OPERATORS,
 	HANDLE_RELATIVE_FONT_HEIGHT_LIMITS,
 	HANDLE_IS_TEXT_MODE,
+    HANDLE_GREEK_CHAR_STYLE,
 	HANDLE_ALIGNMENT,
 	HANDLE_RELATIVE_SPACING,
 	HANDLE_RELATIVE_LINE_SPACING,
 		{ RTL_CONSTASCII_STRINGPARAM( "Formula"							  ),	HANDLE_FORMULA							   , 		&::getCppuType((const OUString*)0), 	PROPERTY_NONE, 0},
 		{ RTL_CONSTASCII_STRINGPARAM( "IsScaleAllBrackets"              ), HANDLE_IS_SCALE_ALL_BRACKETS              , 		&::getBooleanCppuType(), 	PROPERTY_NONE, 0},
 		{ RTL_CONSTASCII_STRINGPARAM( "IsTextMode"                       ), HANDLE_IS_TEXT_MODE                       , 		&::getBooleanCppuType(), 	PROPERTY_NONE, 0},
+		{ RTL_CONSTASCII_STRINGPARAM( "GreekCharStyle" ),                   HANDLE_GREEK_CHAR_STYLE,    &::getCppuType((const sal_Int16*)0),    PROPERTY_NONE, 0},
 		{ RTL_CONSTASCII_STRINGPARAM( "LeftMargin"               		  ), HANDLE_LEFT_MARGIN        		           , 		&::getCppuType((const sal_Int16*)0), 	PROPERTY_NONE, DIS_LEFTSPACE			     },
 		{ RTL_CONSTASCII_STRINGPARAM( "PrinterName"                	   ), HANDLE_PRINTER_NAME               		 , 		&::getCppuType((const OUString*)0), 	PROPERTY_NONE, 0			      },
 		{ RTL_CONSTASCII_STRINGPARAM( "PrinterSetup"                	   ), HANDLE_PRINTER_SETUP               		 , 		&::getCppuType((const Sequence < sal_Int8 >*)0), 	PROPERTY_NONE, 0			      },
 			{
 				aFormat.SetTextmode(*(sal_Bool*)(*pValues).getValue());
 			}
+            break;
+
+            case HANDLE_GREEK_CHAR_STYLE                    :
+			{
+				sal_Int16 nVal = 0;
+				*pValues >>= nVal;
+				if (nVal < 0 || nVal > 2)
+					throw IllegalArgumentException();
+				aFormat.SetGreekCharStyle( nVal );
+			}
 			break;
 
 			case HANDLE_ALIGNMENT                          :
 			}
 			break;
 
+            case HANDLE_GREEK_CHAR_STYLE                    :
+				*pValue <<= (sal_Int16)aFormat.GetGreekCharStyle();
+			break;
+
 			case HANDLE_ALIGNMENT                          :
 				// SmHorAlign uses the same values as HorizontalAlignment
 				*pValue <<= (sal_Int16)aFormat.GetHorAlign();

starmath/source/view.cxx

 		case SID_INSERTTEXT:
 		{
 			const SfxStringItem& rItem =
-				(const SfxStringItem&)rReq.GetArgs()->Get(SID_INSERTTEXT);
-
+				    (const SfxStringItem&)rReq.GetArgs()->Get(SID_INSERTTEXT);
 			if (pWin)
 				pWin->InsertText(rItem.GetValue());
 			break;

sw/source/core/edit/edlingu.cxx

 
 void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck)
 {
+    // Note: rNewPortions.size() == 0 is valid and happens when the whole
+    // sentence got removed in the dialog
+
     ASSERT(  pSpellIter, "SpellIter missing" );
-    if(pSpellIter)
+    if(pSpellIter &&
+       pSpellIter->GetLastPortions().size() > 0)    // no portions -> no text to be changed
     {
         const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
         const SpellContentPositions  rLastPositions = pSpellIter->GetLastPositions();
         // iterate over the new portions, beginning at the end to take advantage of the previously
         // saved content positions
 
-        if(!rLastPortions.size())
-            return;
-
         pDoc->StartUndo( UNDO_OVERWRITE, NULL );
         StartAction();
 
         sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
         if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
         {
+            DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
+            DBG_ASSERT( rLastPortions.size() > 0, "rLastPortions should not be empty here" );
+            DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+
             //the simple case: the same number of elements on both sides
             //each changed element has to be applied to the corresponding source element
             svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
                 //jump over redline portions
                 while(aCurrentOldPortion->bIsHidden)
                 {
-                    --aCurrentOldPortion;
-                    --aCurrentOldPosition;
+                    if (aCurrentOldPortion  != rLastPortions.begin() &&
+                        aCurrentOldPosition != rLastPositions.begin())
+                    {
+                        --aCurrentOldPortion;
+                        --aCurrentOldPosition;
+                    }
+                    else
+                    {
+                        DBG_ASSERT( 0, "ApplyChangedSentence: iterator positions broken" );
+                        break;
+                    }
                 }
 				if ( !pCrsr->HasMark() )
 					pCrsr->SetMark();
         }
         else
         {
+            DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+
             //select the complete sentence
             SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
             --aCurrentEndPosition;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.