From d791366863cf9659a01b171ce0e727bfe2f28cdf Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 18 Sep 2000 16:07:07 +0000 Subject: initial import --- starmath/source/dialog.cxx | 2405 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2405 insertions(+) create mode 100644 starmath/source/dialog.cxx (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx new file mode 100644 index 000000000000..056103b3c61b --- /dev/null +++ b/starmath/source/dialog.cxx @@ -0,0 +1,2405 @@ +/************************************************************************* + * + * $RCSfile: dialog.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:57:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#pragma hdrstop + +#define SMDLL 1 + +#ifndef _TOOLS_RCID_H +#include "tools/rcid.h" +#endif + +#ifndef _SFXENUMITEM_HXX //autogen +#include +#endif +#ifndef _SFXINTITEM_HXX //autogen +#include +#endif +#ifndef _IODLG_HXX +#include +#endif +#ifndef _SFXSTRITEM_HXX //autogen +#include +#endif +#ifndef _SFXAPP_HXX //autogen +#include +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include +#endif +#ifndef _CTRLTOOL_HXX //autogen +#include +#endif +#ifndef _SFX_PRINTER_HXX +#include +#endif +#ifndef _SV_SOUND_HXX //autogen +#include +#endif +#ifndef _SV_SNDSTYLE_HXX //autogen +#include +#endif +#ifndef _SV_WAITOBJ_HXX +#include +#endif +#ifndef _SFXDISPATCH_HXX //autogen +#include +#endif +#ifndef _SFX_HRC //autogen +#include +#endif +#ifndef _STRING_HXX //autogen +#include +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include +#endif + + +#ifndef CONFIG_HXX +#include "config.hxx" +#endif +#ifndef DIALOG_HXX +#include "dialog.hxx" +#endif +#ifndef _STARMATH_HRC +#include "starmath.hrc" +#endif +#ifndef _SMMOD_HXX +#include "smmod.hxx" +#endif +#ifndef SYMBOL_HXX +#include "symbol.hxx" +#endif +#ifndef VIEW_HXX +#include "view.hxx" +#endif +#ifndef DOCUMENT_HXX +#include "document.hxx" +#endif + +//////////////////////////////////////// +// +// Da der FontStyle besser über die Attribute gesetzt/abgefragt wird als über +// den StyleName bauen wir uns hier unsere eigene Übersetzung +// Attribute <-> StyleName +// Die Bits des Index stellen die Attribute dar: +// Bit 0 : italic +// Bit 1 : bold +// + +static XubString __READONLY_DATA aStyleName[4] = +{ + C2S("normal"), C2S("italic"), + C2S("bold"), C2S("bold italic") +}; + +USHORT aStyleNameCount = sizeof(aStyleName) / sizeof(aStyleName[0]); + + +const XubString GetFontStyleName(const Font &rFont) +{ + USHORT nIndex = 2 * (rFont.GetWeight() == WEIGHT_BOLD) + + 1 * (rFont.GetItalic() == ITALIC_NORMAL); + return aStyleName[nIndex]; +} + + +void SetFontStyle(const XubString &rStyleName, Font &rFont) +{ + // finden des Index passend zum StyleName fuer den leeren StyleName wird + // 0 (nicht bold nicht italic) angenommen. + USHORT nIndex = 0; + if (rStyleName.Len()) + { + USHORT i; + for (i = 0; i < aStyleNameCount; i++) + if (rStyleName.CompareTo(aStyleName[i]) == COMPARE_EQUAL) + break; + DBG_ASSERT(i < aStyleNameCount, "Sm : StyleName unbekannt"); + nIndex = i; + } + + rFont.SetItalic((nIndex & 0x1) ? ITALIC_NORMAL : ITALIC_NONE); + rFont.SetWeight((nIndex & 0x2) ? WEIGHT_BOLD : WEIGHT_NORMAL); +} + + +/**************************************************************************/ + +SmAboutDialog::SmAboutDialog(Window *pParent, BOOL bFreeRes) : + ModalDialog (pParent, SmResId(RID_DEFAULTABOUT)), + aFixedText1 (this, ResId(1)), + aFixedText2 (this, ResId(2)), + aFixedText3 (this, ResId(3)), + aFixedText4 (this, ResId(4)), + aFixedText5 (this, ResId(5)), + aFixedText6 (this, ResId(6)), + aReleaseText (this, ResId(7)), + aFixedBitmap1(this, ResId(1)), + aOKButton1 (this, ResId(1)) +{ + if (bFreeRes) + FreeResource(); + +#ifndef PRODUCT + aReleaseText.Show(); +#else + aReleaseText.Hide(); +#endif + +} + +/**************************************************************************/ + + +IMPL_LINK_INLINE_START( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButton ) +{ + aZoom.Enable(aSizeZoomed.IsChecked()); + return 0; +} +IMPL_LINK_INLINE_END( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButton ) + + +SmPrintOptionsTabPage::SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions) + : SfxTabPage(pParent, SmResId(RID_PRINTOPTIONPAGE), rOptions), + aGroupBox1 (this, ResId(1)), + aTitle (this, ResId(1)), + aText (this, ResId(2)), + aFrame (this, ResId(3)), + aGroupBox3 (this, ResId(3)), + aNoRightSpaces (this, ResId(4)), + aGroupBox2 (this, ResId(2)), + aSizeNormal (this, ResId(1)), + aSizeScaled (this, ResId(2)), + aSizeZoomed (this, ResId(3)), + aZoom (this, ResId(1)) +{ + FreeResource(); + + aSizeNormal.SetClickHdl(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); + aSizeScaled.SetClickHdl(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); + aSizeZoomed.SetClickHdl(LINK(this, SmPrintOptionsTabPage, SizeButtonClickHdl)); + + Reset(rOptions); +} + + +BOOL SmPrintOptionsTabPage::FillItemSet(SfxItemSet& rSet) +{ + UINT16 nPrintSize; + if (aSizeNormal.IsChecked()) + nPrintSize = PRINT_SIZE_NORMAL; + else if (aSizeScaled.IsChecked()) + nPrintSize = PRINT_SIZE_SCALED; + else + nPrintSize = PRINT_SIZE_ZOOMED; + + rSet.Put(SfxUInt16Item(GetWhich(SID_PRINTSIZE), (UINT16) nPrintSize)); + rSet.Put(SfxUInt16Item(GetWhich(SID_PRINTZOOM), (UINT16) aZoom.GetValue())); + rSet.Put(SfxBoolItem(GetWhich(SID_PRINTTITLE), aTitle.IsChecked())); + rSet.Put(SfxBoolItem(GetWhich(SID_PRINTTEXT), aText.IsChecked())); + rSet.Put(SfxBoolItem(GetWhich(SID_PRINTFRAME), aFrame.IsChecked())); + rSet.Put(SfxBoolItem(GetWhich(SID_NO_RIGHT_SPACES), aNoRightSpaces.IsChecked())); + + return TRUE; +} + + +void SmPrintOptionsTabPage::Reset(const SfxItemSet& rSet) +{ + SmPrintSize ePrintSize = (SmPrintSize)((const SfxUInt16Item &)rSet.Get(GetWhich(SID_PRINTSIZE))).GetValue(); + + aSizeNormal.Check(ePrintSize == PRINT_SIZE_NORMAL); + aSizeScaled.Check(ePrintSize == PRINT_SIZE_SCALED); + aSizeZoomed.Check(ePrintSize == PRINT_SIZE_ZOOMED); + + aZoom.Enable(aSizeZoomed.IsChecked()); + + aZoom.SetValue(((const SfxUInt16Item &)rSet.Get(GetWhich(SID_PRINTZOOM))).GetValue()); + + aTitle.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_PRINTTITLE))).GetValue()); + aText.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_PRINTTEXT))).GetValue()); + aFrame.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_PRINTFRAME))).GetValue()); + aNoRightSpaces.Check(((const SfxBoolItem &)rSet.Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue()); +} + + +SfxTabPage* SmPrintOptionsTabPage::Create(Window* pWindow, const SfxItemSet& rSet) +{ + return (new SmPrintOptionsTabPage(pWindow, rSet)); +} + +/**************************************************************************/ + + +#ifdef NEVER +SmExtraOptionsTabPage::SmExtraOptionsTabPage(const SfxItemSet& rInSet, Window * pParent, BOOL bFreeRes) + : SfxTabPage(pParent, SmResId(RID_EXTRAOPTIONPAGE), rInSet), + aAutoRedraw (this, ResId(1)), + aFixedText1 (this, ResId(1)), + aSymbolFile (this, ResId(2), 32), + aBrowseButton (this, ResId(1)) +{ + if (bFreeRes) + FreeResource(); + + aBrowseButton.SetClickHdl(LINK(this, SmExtraOptionsTabPage, SymClickHdl)); +} + + +IMPL_LINK( SmExtraOptionsTabPage, SymClickHdl, PushButton *, pPushButton ) +{ + SfxSimpleFileDialog *pFileDialog = + new SfxSimpleFileDialog(this, WinBits(WB_OPEN | WB_3DLOOK)); + +#ifdef MAC + pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), SmResId(RID_FILESYMTYP)); + pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), "****"); + + pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); +#else + pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), C2S("*.sms")); + pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), C2S("*.*")); + + pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); + + pFileDialog->SetDefaultExt(C2S("*.sms")); +#endif + + pFileDialog->SetPath(aSymbolFile.GetText()); + + if (pFileDialog->Execute() == RET_OK) + aSymbolFile.SetText(pFileDialog->GetPath()); + + delete pFileDialog; + return 0; +} + + +BOOL SmExtraOptionsTabPage::FillItemSet(SfxItemSet& rOutSet) +{ + rOutSet.Put(SfxBoolItem(GetWhich(SID_AUTOREDRAW), aAutoRedraw.IsChecked())); + rOutSet.Put(SfxStringItem(GetWhich(SID_SYMBOLFILE), aSymbolFile.GetText())); + + return (TRUE); +} + + +void SmExtraOptionsTabPage::Reset(const SfxItemSet& rOutSet) +{ + aAutoRedraw.Check(((const SfxBoolItem&)rOutSet.Get(GetWhich(SID_AUTOREDRAW))).GetValue()); + aSymbolFile.SetText(((const SfxStringItem&)rOutSet.Get(GetWhich(SID_SYMBOLFILE))).GetValue()); +} + + +SfxTabPage* SmExtraOptionsTabPage::Create(Window* pWindow, const SfxItemSet& rSet) +{ + return (new SmExtraOptionsTabPage(rSet, pWindow)); +} +#endif //NEVER + +/**************************************************************************/ + + +void SmShowFont::Paint(const Rectangle&) +{ + XubString Text (GetFont().GetName()); + Size TextSize(GetTextWidth(Text), GetTextHeight()); + + DrawText(Point((GetOutputSize().Width() - TextSize.Width()) / 2, + (GetOutputSize().Height() - TextSize.Height()) / 2), Text); +} + + +void SmShowFont::SetFont(const Font& rFont) +{ + Font aFont (rFont); + + Invalidate(); + aFont.SetSize(Size(0, 24)); + aFont.SetAlign(ALIGN_TOP); + Control::SetFont(aFont); +} + + +IMPL_LINK_INLINE_START( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) +{ + Face.SetName(pComboBox->GetText()); + aShowFont.SetFont(Face); + return 0; +} +IMPL_LINK_INLINE_END( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) + + +IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, pCheckBox ) +{ + if (aBoldCheckBox.IsChecked()) + Face.SetWeight(FontWeight(WEIGHT_BOLD)); + else + Face.SetWeight(FontWeight(WEIGHT_NORMAL)); + + if (aItalicCheckBox.IsChecked()) + Face.SetItalic(ITALIC_NORMAL); + else + Face.SetItalic(ITALIC_NONE); + + aShowFont.SetFont(Face); + return 0; +} + + +void SmFontDialog::SetFont(const Font &rFont) +{ + Face = rFont; + + aFontBox.SetText(Face.GetName()); + aBoldCheckBox.Check(Face.GetWeight() == WEIGHT_BOLD); + aItalicCheckBox.Check(Face.GetItalic() != ITALIC_NONE); + + aShowFont.SetFont(Face); +} + + +SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) + : ModalDialog(pParent,SmResId(RID_FONTDIALOG)), + aFixedText1 (this, ResId(1)), + aFontBox (this, ResId(1)), + aBoldCheckBox (this, ResId(1)), + aItalicCheckBox (this, ResId(2)), + aOKButton1 (this, ResId(1)), + aCancelButton1 (this, ResId(1)), + aShowFont (this, ResId(1)), + aGroupBox1 (this, ResId(1)), + aGroupBox2 (this, ResId(2)) +{ + if (bFreeRes) + FreeResource(); + + { + WaitObject( this ); + //Application::EnterWait(); + + // get FontList from printer (if possible), otherwise from application window + SmViewShell *pView = SmGetActiveView(); + DBG_ASSERT(pView, "Sm : NULL pointer"); + OutputDevice *pDev = pView->GetDoc()->GetPrinter(); + if (!pDev || pDev->GetDevFontCount() == 0) + pDev = &pView->GetGraphicWindow(); + FontList aFontList(pDev); + + USHORT nCount = aFontList.GetFontNameCount(); + for (USHORT i = 0; i < nCount; i++) + aFontBox.InsertEntry( aFontList.GetFontName(i).GetName() ); + + Face.SetSize(Size(0, 24)); + Face.SetWeight(WEIGHT_NORMAL); + Face.SetItalic(ITALIC_NONE); + Face.SetFamily(FAMILY_DONTKNOW); + Face.SetPitch(PITCH_DONTKNOW); + Face.SetCharSet(RTL_TEXTENCODING_DONTKNOW); + Face.SetTransparent(TRUE); + + aShowFont.SetFillColor( Color(COL_LIGHTGRAY) ); + + //Application::LeaveWait(); + } + + aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontChangeHdl)); + aBoldCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); + aItalicCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); +} + +/**************************************************************************/ + + +IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, pButton ) +{ + QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); + + if (pQueryBox->Execute() == RET_YES) + { + SmModule *pp = SM_MOD1(); + WriteTo(pp->GetConfig()->GetFormat()); + } + + delete pQueryBox; + return 0; +} + + +SmFontSizeDialog::SmFontSizeDialog(Window * pParent, BOOL bFreeRes) + : ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)), + aFixedText1(this, ResId(1)), + aBaseSize(this, ResId(1)), + aFixedText4(this, ResId(4)), + aTextSize(this, ResId(4)), + aFixedText5(this, ResId(5)), + aIndexSize(this, ResId(5)), + aFixedText6(this, ResId(6)), + aFunctionSize(this, ResId(6)), + aFixedText7(this, ResId(7)), + aOperatorSize(this, ResId(7)), + aFixedText8(this, ResId(8)), + aBorderSize(this, ResId(8)), + aGroupBox1(this, ResId(1)), + aOKButton1(this, ResId(1)), + aCancelButton1(this, ResId(1)), + aDefaultButton(this, ResId(1)) +{ + if (bFreeRes) + FreeResource(); + + aDefaultButton.SetClickHdl(LINK(this, SmFontSizeDialog, DefaultButtonClickHdl)); +} + + +void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat) +{ + //! aufpassen: richtig runden! + aBaseSize.SetValue( SmRoundFraction( + Sm100th_mmToPts( rFormat.GetBaseSize().Height() ) ) ); + + aTextSize .SetValue( rFormat.GetRelSize(SIZ_TEXT) ); + aIndexSize .SetValue( rFormat.GetRelSize(SIZ_INDEX) ); + aFunctionSize.SetValue( rFormat.GetRelSize(SIZ_FUNCTION) ); + aOperatorSize.SetValue( rFormat.GetRelSize(SIZ_OPERATOR) ); + aBorderSize .SetValue( rFormat.GetRelSize(SIZ_LIMITS) ); +} + + +void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const +{ + rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm(aBaseSize.GetValue())) ); + + rFormat.SetRelSize(SIZ_TEXT, (USHORT) aTextSize .GetValue()); + rFormat.SetRelSize(SIZ_INDEX, (USHORT) aIndexSize .GetValue()); + rFormat.SetRelSize(SIZ_FUNCTION, (USHORT) aFunctionSize.GetValue()); + rFormat.SetRelSize(SIZ_OPERATOR, (USHORT) aOperatorSize.GetValue()); + rFormat.SetRelSize(SIZ_LIMITS, (USHORT) aBorderSize .GetValue()); + + const Size aTmp (rFormat.GetBaseSize()); + for (USHORT i = FNT_BEGIN; i <= FNT_END; i++) + rFormat.Font(i).SetSize(aTmp); + + rFormat.RequestApplyChanges(); +} + + +/**************************************************************************/ + + +IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) +{ + SmFontPickListBox *pActiveListBox; + + switch (pMenu->GetCurItemId()) + { + case 1: pActiveListBox = &aVariableFont; break; + case 2: pActiveListBox = &aFunctionFont; break; + case 3: pActiveListBox = &aNumberFont; break; + case 4: pActiveListBox = &aTextFont; break; + case 5: pActiveListBox = &aSerifFont; break; + case 6: pActiveListBox = &aSansFont; break; + case 7: pActiveListBox = &aFixedFont; break; + default:pActiveListBox = NULL; + } + + if (pActiveListBox) + { + SmFontDialog *pFontDialog = new SmFontDialog(this); + + pActiveListBox->WriteTo(*pFontDialog); + if (pFontDialog->Execute() == RET_OK) + pActiveListBox->ReadFrom(*pFontDialog); + delete pFontDialog; + } + return 0; +} + + +IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) +{ + QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); + if (pQueryBox->Execute() == RET_YES) + { + SmModule *pp = SM_MOD1(); + WriteTo(pp->GetConfig()->GetFormat()); + } + + delete pQueryBox; + return 0; +} +IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) + + +SmFontTypeDialog::SmFontTypeDialog(Window * pParent, BOOL bFreeRes) + : ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)), + aFixedText1 (this, ResId(1)), + aVariableFont (this, ResId(1)), + aFixedText2 (this, ResId(2)), + aFunctionFont (this, ResId(2)), + aFixedText3 (this, ResId(3)), + aNumberFont (this, ResId(3)), + aFixedText4 (this, ResId(4)), + aTextFont (this, ResId(4)), + aFixedText5 (this, ResId(5)), + aSerifFont (this, ResId(5)), + aFixedText6 (this, ResId(6)), + aSansFont (this, ResId(6)), + aFixedText7 (this, ResId(7)), + aFixedFont (this, ResId(7)), + aGroupBox1 (this, ResId(1)), + aGroupBox2 (this, ResId(2)), + aOKButton1 (this, ResId(1)), + aCancelButton1 (this, ResId(1)), + aMenuButton (this, ResId(1)), + aDefaultButton (this, ResId(2)) +{ + if (bFreeRes) + FreeResource(); + + aDefaultButton.SetClickHdl(LINK(this, SmFontTypeDialog, DefaultButtonClickHdl)); + + aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmFontTypeDialog, MenuSelectHdl)); +} + +void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat) +{ + SmModule *pp = SM_MOD1(); + + aVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE); + aFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION); + aNumberFont = pp->GetConfig()->GetFontPickList(FNT_NUMBER); + aTextFont = pp->GetConfig()->GetFontPickList(FNT_TEXT); + aSerifFont = pp->GetConfig()->GetFontPickList(FNT_SERIF); + aSansFont = pp->GetConfig()->GetFontPickList(FNT_SANS); + aFixedFont = pp->GetConfig()->GetFontPickList(FNT_FIXED); + + aVariableFont.Insert( rFormat.GetFont(FNT_VARIABLE) ); + aFunctionFont.Insert( rFormat.GetFont(FNT_FUNCTION) ); + aNumberFont .Insert( rFormat.GetFont(FNT_NUMBER) ); + aTextFont .Insert( rFormat.GetFont(FNT_TEXT) ); + aSerifFont .Insert( rFormat.GetFont(FNT_SERIF) ); + aSansFont .Insert( rFormat.GetFont(FNT_SANS) ); + aFixedFont .Insert( rFormat.GetFont(FNT_FIXED) ); +} + + +void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const +{ + SmModule *pp = SM_MOD1(); + + pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = aVariableFont; + pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = aFunctionFont; + pp->GetConfig()->GetFontPickList(FNT_NUMBER) = aNumberFont; + pp->GetConfig()->GetFontPickList(FNT_TEXT) = aTextFont; + pp->GetConfig()->GetFontPickList(FNT_SERIF) = aSerifFont; + pp->GetConfig()->GetFontPickList(FNT_SANS) = aSansFont; + pp->GetConfig()->GetFontPickList(FNT_FIXED) = aFixedFont; + + rFormat.SetFont( FNT_VARIABLE, aVariableFont.Get(0) ); + rFormat.SetFont( FNT_FUNCTION, aFunctionFont.Get(0) ); + rFormat.SetFont( FNT_NUMBER, aNumberFont .Get(0) ); + rFormat.SetFont( FNT_TEXT, aTextFont .Get(0) ); + rFormat.SetFont( FNT_SERIF, aSerifFont .Get(0) ); + rFormat.SetFont( FNT_SANS, aSansFont .Get(0) ); + rFormat.SetFont( FNT_FIXED, aFixedFont .Get(0) ); + + for (USHORT i = FNT_BEGIN; i <= FNT_FIXED; i++) + rFormat.Font(i).SetTransparent(TRUE); + + rFormat.RequestApplyChanges(); +} + +/**************************************************************************/ + +struct FieldMinMax +{ + USHORT nMin, nMax; +}; + +// Data for min and max values of the 4 metric fields +// for each of the 10 categories +static const FieldMinMax pMinMaxData[10][4] = +{ + // 0 + {{ 0, 200 }, { 0, 200 }, { 0, 100 }, { 0, 0 }}, + // 1 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 0 }}, + // 2 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 0 }}, + // 3 + {{ 0, 100 }, { 1, 100 }, { 0, 0 }, { 0, 0 }}, + // 4 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 0 }}, + // 5 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 100 }}, + // 6 + {{ 0, 300 }, { 0, 300 }, { 0, 0 }, { 0, 0 }}, + // 7 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 0 }}, + // 8 + {{ 0, 100 }, { 0, 100 }, { 0, 0 }, { 0, 0 }}, + // 9 + {{ 0, 10000 }, { 0, 10000 }, { 0, 10000 }, { 0, 10000 }} +}; + +SmCategoryDesc::SmCategoryDesc(const ResId& rResId, USHORT nCategoryIdx) : + Resource(rResId) +{ + if (IsAvailableRes(ResId(1).SetRT(RSC_STRING))) + { + Name = XubString(ResId(1)); + + int i; + for (i = 0; i < 4; i++) + { + int nI2 = i + 2; + + if (IsAvailableRes(ResId(nI2).SetRT(RSC_STRING))) + { + Strings[i] = new XubString(ResId(nI2)); + Graphics[i] = new Bitmap(ResId(nI2)); + } + else + { + Strings[i] = 0; + Graphics[i] = 0; + } + } + + for (i = 0; i < 4; i++) + { + const FieldMinMax &rMinMax = pMinMaxData[ nCategoryIdx ][i]; + Value[i] = Minimum[i] = rMinMax.nMin; + Maximum[i] = rMinMax.nMax; + } + } + + FreeResource(); +} + + +SmCategoryDesc::~SmCategoryDesc() +{ + for (int i = 0; i < 4; i++) + { + delete Strings[i]; + delete Graphics[i]; + } +} + +/**************************************************************************/ + +IMPL_LINK( SmDistanceDialog, GetFocusHdl, Control *, pControl ) +{ + if (Categories[nActiveCategory]) + { + USHORT i; + + if (pControl == &aMetricField1) + i = 0; + else if (pControl == &aMetricField2) + i = 1; + else if (pControl == &aMetricField3) + i = 2; + else if (pControl == &aMetricField4) + i = 3; + else + return 0; + aBitmap.SetBitmap(*(Categories[nActiveCategory]->GetGraphic(i))); + } + return 0; +} + +IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu ) +{ + SetCategory(pMenu->GetCurItemId() - 1); + return 0; +} + + +IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, pButton ) +{ + QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); + + if (pQueryBox->Execute() == RET_YES) + { + SmModule *pp = SM_MOD1(); + WriteTo(pp->GetConfig()->GetFormat()); + } + delete pQueryBox; + return 0; +} + + +IMPL_LINK( SmDistanceDialog, CheckBoxClickHdl, CheckBox *, pCheckBox ) +{ + if (pCheckBox == &aCheckBox1) + { + aCheckBox1.Toggle(); + + BOOL bChecked = aCheckBox1.IsChecked(); + aFixedText4 .Enable( bChecked ); + aMetricField4.Enable( bChecked ); + } + return 0; +} + + +void SmDistanceDialog::SetHelpId(MetricField &rField, ULONG nHelpId) +{ + //! HelpID's die auf diese Weise explizit gesetzt werden, müssen im + //! util Verzeichnis im File "hidother.src" mit Hilfe von "hidspecial" + //! definiert werden! + + const XubString aEmptyText; + DBG_ASSERT(aEmptyText.Len() == 0, "Sm: Ooops..."); + + rField.SetHelpId(nHelpId); + rField.SetHelpText(aEmptyText); + + // since MetricField inherits from SpinField which has a sub Edit field + // (which is actually the one we modify) we have to set the help-id + // for it too. + Edit *pSubEdit = rField.GetSubEdit(); + if (pSubEdit) + { pSubEdit->SetHelpId(nHelpId); + pSubEdit->SetHelpText(aEmptyText); + } +} + + +void SmDistanceDialog::SetCategory(USHORT nCategory) +{ + DBG_ASSERT(0 <= nCategory && nCategory < NOCATEGORIES, + "Sm: falsche Kategorienummer in SmDistanceDialog"); + + // array to convert category- and metricfield-number in help ids. + // 0 is used in case of unused combinations. + DBG_ASSERT(NOCATEGORIES == 10, "Sm : Array paßt nicht zu Anzahl der Kategorien"); + ULONG __READONLY_DATA aCatMf2Hid[10][4] = + { + HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, 0, + HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , 0, 0, + HID_SMA_NUMERATOR_DIST, HID_SMA_DENOMINATOR_DIST, 0, 0, + HID_SMA_FRACLINE_EXCWIDTH, HID_SMA_FRACLINE_LINEWIDTH, 0, 0, + HID_SMA_UPPERLIMIT_DIST, HID_SMA_LOWERLIMIT_DIST, 0, 0, + HID_SMA_BRACKET_EXCHEIGHT, HID_SMA_BRACKET_DIST, 0, HID_SMA_BRACKET_EXCHEIGHT2, + HID_SMA_MATRIXROW_DIST, HID_SMA_MATRIXCOL_DIST, 0, 0, + HID_SMA_ATTRIBUT_DIST, HID_SMA_INTERATTRIBUT_DIST, 0, 0, + HID_SMA_OPERATOR_EXCHEIGHT, HID_SMA_OPERATOR_DIST, 0, 0, + HID_SMA_LEFTBORDER_DIST, HID_SMA_RIGHTBORDER_DIST, HID_SMA_UPPERBORDER_DIST, HID_SMA_LOWERBORDER_DIST + }; + + // array to help iterate over the controls + Window * __READONLY_DATA aWin[4][2] = + { + &aFixedText1, &aMetricField1, + &aFixedText2, &aMetricField2, + &aFixedText3, &aMetricField3, + &aFixedText4, &aMetricField4 + }; + + SmCategoryDesc *pCat; + + // merken der (evtl neuen) Einstellungen der aktiven SmCategoryDesc + // bevor zu der neuen gewechselt wird. + if (nActiveCategory != CATEGORY_NONE) + { + pCat = Categories[nActiveCategory]; + pCat->SetValue(0, (USHORT) aMetricField1.GetValue()); + pCat->SetValue(1, (USHORT) aMetricField2.GetValue()); + pCat->SetValue(2, (USHORT) aMetricField3.GetValue()); + pCat->SetValue(3, (USHORT) aMetricField4.GetValue()); + + if (nActiveCategory == 5) + bScaleAllBrackets = aCheckBox1.IsChecked(); + + aMenuButton.GetPopupMenu()->CheckItem(nActiveCategory + 1, FALSE); + } + + // aktivieren/deaktivieren der zugehörigen Controls in Abhängigkeit von der + // gewählten Kategorie. + BOOL bActive; + for (int i = 0; i < 4; i++) + { + FixedText *pFT = (FixedText * const) aWin[i][0]; + MetricField *pMF = (MetricField * const) aWin[i][1]; + + // Um feststellen welche Controls aktiv sein sollen wird das + // vorhandensein einer zugehörigen HelpID überprüft. + bActive = aCatMf2Hid[nCategory][i] != 0; + + pFT->Show(bActive); + pFT->Enable(bActive); + pMF->Show(bActive); + pMF->Enable(bActive); + + // setzen von Maßeinheit und Anzahl der Nachkommastellen + FieldUnit eUnit; + USHORT nDigits; + if (nCategory < 9) + { + eUnit = FUNIT_CUSTOM; + nDigits = 0; + pMF->SetCustomUnitText( '%' ); + } + else + { + eUnit = FUNIT_100TH_MM; + nDigits = 2; + } + pMF->SetUnit(eUnit); //! verändert den Wert + pMF->SetDecimalDigits(nDigits); + + if (bActive) + { + pCat = Categories[nCategory]; + pFT->SetText(*pCat->GetString(i)); + + pMF->SetMin(pCat->GetMinimum(i)); + pMF->SetMax(pCat->GetMaximum(i)); + pMF->SetValue(pCat->GetValue(i)); + + SetHelpId(*pMF, aCatMf2Hid[nCategory][i]); + } + } + // nun noch die CheckBox und das zugehörige MetricField genau dann aktivieren, + // falls es sich um das Klammer Menu handelt. + bActive = nCategory == 5; + aCheckBox1.Show(bActive); + aCheckBox1.Enable(bActive); + if (bActive) + { + aCheckBox1.Check( bScaleAllBrackets ); + + BOOL bChecked = aCheckBox1.IsChecked(); + aFixedText4 .Enable( bChecked ); + aMetricField4.Enable( bChecked ); + } + + aMenuButton.GetPopupMenu()->CheckItem(nCategory + 1, TRUE); + aGroupBox.SetText(Categories[nCategory]->GetName()); + + nActiveCategory = nCategory; + + aMetricField1.GrabFocus(); + Invalidate(); + Update(); +} + + +SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) + : ModalDialog(pParent, SmResId(RID_DISTANCEDIALOG)), + aFixedText1 (this, ResId(1)), + aFixedText2 (this, ResId(2)), + aFixedText3 (this, ResId(3)), + aFixedText4 (this, ResId(4)), + aMetricField1 (this, ResId(1)), + aMetricField2 (this, ResId(2)), + aMetricField3 (this, ResId(3)), + aMetricField4 (this, ResId(4)), + aOKButton1 (this, ResId(1)), + aCancelButton1 (this, ResId(1)), + aMenuButton (this, ResId(1)), + aDefaultButton (this, ResId(1)), + aCheckBox1 (this, ResId(1)), + aBitmap (this, ResId(1)), + aGroupBox (this, ResId(1)) +{ + for (int i = 0; i < NOCATEGORIES; i++) + Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); + nActiveCategory = CATEGORY_NONE; + bScaleAllBrackets = FALSE; + + if (bFreeRes) + FreeResource(); + + aMetricField1.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); + aMetricField2.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); + aMetricField3.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); + aMetricField4.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); + aCheckBox1.SetClickHdl(LINK(this, SmDistanceDialog, CheckBoxClickHdl)); + + aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmDistanceDialog, MenuSelectHdl)); + + aDefaultButton.SetClickHdl(LINK(this, SmDistanceDialog, DefaultButtonClickHdl)); + } + + +SmDistanceDialog::~SmDistanceDialog() +{ + for (int i = 0; i < NOCATEGORIES; i++) + DELETEZ(Categories[i]); +} + + +void SmDistanceDialog::ReadFrom(const SmFormat &rFormat) +{ + Categories[0]->SetValue(0, rFormat.GetDistance(DIS_HORIZONTAL)); + Categories[0]->SetValue(1, rFormat.GetDistance(DIS_VERTICAL)); + Categories[0]->SetValue(2, rFormat.GetDistance(DIS_ROOT)); + Categories[1]->SetValue(0, rFormat.GetDistance(DIS_SUPERSCRIPT)); + Categories[1]->SetValue(1, rFormat.GetDistance(DIS_SUBSCRIPT)); + Categories[2]->SetValue(0, rFormat.GetDistance(DIS_NUMERATOR)); + Categories[2]->SetValue(1, rFormat.GetDistance(DIS_DENOMINATOR)); + Categories[3]->SetValue(0, rFormat.GetDistance(DIS_FRACTION)); + Categories[3]->SetValue(1, rFormat.GetDistance(DIS_STROKEWIDTH)); + Categories[4]->SetValue(0, rFormat.GetDistance(DIS_UPPERLIMIT)); + Categories[4]->SetValue(1, rFormat.GetDistance(DIS_LOWERLIMIT)); + Categories[5]->SetValue(0, rFormat.GetDistance(DIS_BRACKETSIZE)); + Categories[5]->SetValue(1, rFormat.GetDistance(DIS_BRACKETSPACE)); + Categories[5]->SetValue(3, rFormat.GetDistance(DIS_NORMALBRACKETSIZE)); + Categories[6]->SetValue(0, rFormat.GetDistance(DIS_MATRIXROW)); + Categories[6]->SetValue(1, rFormat.GetDistance(DIS_MATRIXCOL)); + Categories[7]->SetValue(0, rFormat.GetDistance(DIS_ORNAMENTSIZE)); + Categories[7]->SetValue(1, rFormat.GetDistance(DIS_ORNAMENTSPACE)); + Categories[8]->SetValue(0, rFormat.GetDistance(DIS_OPERATORSIZE)); + Categories[8]->SetValue(1, rFormat.GetDistance(DIS_OPERATORSPACE)); + Categories[9]->SetValue(0, rFormat.GetDistance(DIS_LEFTSPACE)); + Categories[9]->SetValue(1, rFormat.GetDistance(DIS_RIGHTSPACE)); + Categories[9]->SetValue(2, rFormat.GetDistance(DIS_TOPSPACE)); + Categories[9]->SetValue(3, rFormat.GetDistance(DIS_BOTTOMSPACE)); + + bScaleAllBrackets = rFormat.IsScaleNormalBrackets(); + + // force update (even of category 0) by setting nActiveCategory to a + // non-existent category number + nActiveCategory = CATEGORY_NONE; + SetCategory(0); +} + + +void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ +{ + // hmm... k”nnen die tats„chlich unterschiedlich sein? + // wenn nicht kann oben n„mlich das const stehen! + SetCategory(nActiveCategory); + + rFormat.SetDistance( DIS_HORIZONTAL, Categories[0]->GetValue(0) ); + rFormat.SetDistance( DIS_VERTICAL, Categories[0]->GetValue(1) ); + rFormat.SetDistance( DIS_ROOT, Categories[0]->GetValue(2) ); + rFormat.SetDistance( DIS_SUPERSCRIPT, Categories[1]->GetValue(0) ); + rFormat.SetDistance( DIS_SUBSCRIPT, Categories[1]->GetValue(1) ); + rFormat.SetDistance( DIS_NUMERATOR, Categories[2]->GetValue(0) ); + rFormat.SetDistance( DIS_DENOMINATOR, Categories[2]->GetValue(1) ); + rFormat.SetDistance( DIS_FRACTION, Categories[3]->GetValue(0) ); + rFormat.SetDistance( DIS_STROKEWIDTH, Categories[3]->GetValue(1) ); + rFormat.SetDistance( DIS_UPPERLIMIT, Categories[4]->GetValue(0) ); + rFormat.SetDistance( DIS_LOWERLIMIT, Categories[4]->GetValue(1) ); + rFormat.SetDistance( DIS_BRACKETSIZE, Categories[5]->GetValue(0) ); + rFormat.SetDistance( DIS_BRACKETSPACE, Categories[5]->GetValue(1) ); + rFormat.SetDistance( DIS_MATRIXROW, Categories[6]->GetValue(0) ); + rFormat.SetDistance( DIS_MATRIXCOL, Categories[6]->GetValue(1) ); + rFormat.SetDistance( DIS_ORNAMENTSIZE, Categories[7]->GetValue(0) ); + rFormat.SetDistance( DIS_ORNAMENTSPACE, Categories[7]->GetValue(1) ); + rFormat.SetDistance( DIS_OPERATORSIZE, Categories[8]->GetValue(0) ); + rFormat.SetDistance( DIS_OPERATORSPACE, Categories[8]->GetValue(1) ); + rFormat.SetDistance( DIS_LEFTSPACE, Categories[9]->GetValue(0) ); + rFormat.SetDistance( DIS_RIGHTSPACE, Categories[9]->GetValue(1) ); + rFormat.SetDistance( DIS_TOPSPACE, Categories[9]->GetValue(2) ); + rFormat.SetDistance( DIS_BOTTOMSPACE, Categories[9]->GetValue(3) ); + rFormat.SetDistance( DIS_NORMALBRACKETSIZE, Categories[5]->GetValue(3) ); + + rFormat.SetScaleNormalBrackets( bScaleAllBrackets ); + + rFormat.RequestApplyChanges(); +} + + +/**************************************************************************/ + + +IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, pButton ) +{ + QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); + + if (pQueryBox->Execute() == RET_YES) + { + SmModule *pp = SM_MOD1(); + WriteTo(pp->GetConfig()->GetFormat()); + } + + delete pQueryBox; + return 0; +} + + +SmAlignDialog::SmAlignDialog(Window * pParent, BOOL bFreeRes) + : ModalDialog(pParent, SmResId(RID_ALIGNDIALOG)), + aLeft (this, ResId(1)), + aCenter (this, ResId(2)), + aRight (this, ResId(3)), + aGroupBox1 (this, ResId(1)), + aOKButton1 (this, ResId(1)), + aCancelButton1 (this, ResId(1)), + aDefaultButton (this, ResId(1)) +{ + if (bFreeRes) + FreeResource(); + + aDefaultButton.SetClickHdl(LINK(this, SmAlignDialog, DefaultButtonClickHdl)); +} + + +void SmAlignDialog::ReadFrom(const SmFormat &rFormat) +{ + switch (rFormat.GetHorAlign()) + { + case AlignLeft: + aLeft .Check(TRUE); + aCenter.Check(FALSE); + aRight .Check(FALSE); + break; + + case AlignCenter: + aLeft .Check(FALSE); + aCenter.Check(TRUE); + aRight .Check(FALSE); + break; + + case AlignRight: + aLeft .Check(FALSE); + aCenter.Check(FALSE); + aRight .Check(TRUE); + break; + } +} + + +void SmAlignDialog::WriteTo(SmFormat &rFormat) const +{ + if (aLeft.IsChecked()) + rFormat.SetHorAlign(AlignLeft); + else if (aRight.IsChecked()) + rFormat.SetHorAlign(AlignRight); + else + rFormat.SetHorAlign(AlignCenter); + + rFormat.RequestApplyChanges(); +} + + +/**************************************************************************/ + + +void SmShowSymbolSet::Paint(const Rectangle&) +{ + Push(PUSH_MAPMODE); + + // MapUnit einstellen für die 'nLen' berechnet wurde + SetMapMode(MapMode(MAP_PIXEL)); + + int v = (int) (aVScrollBar.GetThumbPos() * nColumns); + int nSymbols = (int) aSymbolSet.GetCount(); + + for (int i = v; i < nSymbols ; i++) + { + SmSym aSymbol (aSymbolSet.GetSymbol(i)); + Font aFont (aSymbol.GetFace()); + + // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben + // (hoffentlich auch genug für links und rechts!) + aFont.SetSize(Size(0, nLen - (nLen / 3))); + SetFont(aFont); + + int nIV = i - v; + Size aSize(GetTextWidth(aSymbol.GetCharacter()), GetTextHeight()); + + DrawText(Point((nIV % nColumns) * nLen + (nLen - aSize.Width()) / 2, + (nIV / nColumns) * nLen + (nLen - aSize.Height()) / 2), + aSymbol.GetCharacter()); + } + + if (nSelectSymbol != SYMBOL_NONE) + { + Invert(Rectangle(Point(((nSelectSymbol - v) % nColumns) * nLen, + ((nSelectSymbol - v) / nColumns) * nLen), + Size(nLen, nLen))); + } + + Pop(); +} + + +void SmShowSymbolSet::MouseButtonDown(const MouseEvent& rMEvt) +{ + GrabFocus(); + + if (rMEvt.IsLeft() && Rectangle(Point(0, 0), aOutputSize).IsInside(rMEvt.GetPosPixel())) + { + SelectSymbol ((rMEvt.GetPosPixel().Y() / nLen) * nColumns + (rMEvt.GetPosPixel().X() / nLen) + + aVScrollBar.GetThumbPos() * nColumns); + + aSelectHdlLink.Call(this); + + if (rMEvt.GetClicks() > 1) aDblClickHdlLink.Call(this); + } + else Control::MouseButtonDown (rMEvt); +} + + +void SmShowSymbolSet::KeyInput(const KeyEvent& rKEvt) +{ + USHORT n = nSelectSymbol; + + if (n != SYMBOL_NONE) + { + switch (rKEvt.GetKeyCode().GetCode()) + { + case KEY_DOWN: n += nColumns; break; + case KEY_UP: n -= nColumns; break; + case KEY_LEFT: n -= 1; break; + case KEY_RIGHT: n += 1; break; + case KEY_HOME: n = 0; break; + case KEY_END: n = aSymbolSet.GetCount() - 1; break; + case KEY_PAGEUP: n -= nColumns * nRows; break; + case KEY_PAGEDOWN: n += nColumns * nRows; break; + + default: + Control::KeyInput(rKEvt); + return; + } + } + else + n = 0; + + if (n >= aSymbolSet.GetCount()) + n = nSelectSymbol; + + // adjust scrollbar + if ((n < (USHORT) (aVScrollBar.GetThumbPos() * nColumns)) || + (n >= (USHORT) ((aVScrollBar.GetThumbPos() + nRows) * nColumns))) + { + aVScrollBar.SetThumbPos(n / nColumns); + Invalidate(); + Update(); + } + + SelectSymbol(n); + aSelectHdlLink.Call(this); +} + + +SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) : + Control(pParent, rResId), + aVScrollBar(this, WinBits(WB_VSCROLL)) +{ + nSelectSymbol = SYMBOL_NONE; + + aOutputSize = GetOutputSizePixel(); + long nScrollBarWidth = aVScrollBar.GetSizePixel().Width(), + nUseableWidth = aOutputSize.Width() - nScrollBarWidth; + + // Höhe von 16pt in Pixeln (passend zu 'aOutputSize') + nLen = (USHORT) LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); + + nColumns = nUseableWidth / nLen; + if (nColumns > 2 && nColumns % 2 != 0) + nColumns--; + nRows = aOutputSize.Height() / nLen; + DBG_ASSERT(nColumns > 0, "Sm : keine Spalten"); + DBG_ASSERT(nRows > 0, "Sm : keine Zeilen"); + + // genau passend machen + aOutputSize.Width() = nColumns * nLen; + aOutputSize.Height() = nRows * nLen; + + aVScrollBar.SetPosSizePixel(Point(aOutputSize.Width() + 1, -1), + Size(nScrollBarWidth, aOutputSize.Height() + 2)); + aVScrollBar.Enable(FALSE); + aVScrollBar.Show(); + aVScrollBar.SetScrollHdl(LINK(this, SmShowSymbolSet, ScrollHdl)); + + Size WindowSize (aOutputSize); + WindowSize.Width() += nScrollBarWidth; + SetOutputSizePixel(WindowSize); + +} + + +void SmShowSymbolSet::SetSymbolSet(const SmSymSet& rSymbolSet) +{ + aSymbolSet = rSymbolSet; + + if (aSymbolSet.GetCount() > (nColumns * nRows)) + { + aVScrollBar.SetRange(Range(0, ((aSymbolSet.GetCount() + (nColumns - 1)) / nColumns) - nRows)); + aVScrollBar.Enable(TRUE); + } + else + { + aVScrollBar.SetRange(Range(0,0)); + aVScrollBar.Enable (FALSE); + } + + Invalidate(); +} + + +void SmShowSymbolSet::SelectSymbol(USHORT nSymbol) +{ + int v = (int) (aVScrollBar.GetThumbPos() * nColumns); + + if (nSelectSymbol != SYMBOL_NONE) + Invalidate(Rectangle(Point(((nSelectSymbol - v) % nColumns) * nLen, + ((nSelectSymbol - v) / nColumns) * nLen), + Size(nLen, nLen))); + + if (nSymbol < aSymbolSet.GetCount()) + nSelectSymbol = nSymbol; + + if (aSymbolSet.GetCount() == 0) + nSelectSymbol = SYMBOL_NONE; + + if (nSelectSymbol != SYMBOL_NONE) + Invalidate(Rectangle(Point(((nSelectSymbol - v) % nColumns) * nLen, + ((nSelectSymbol - v) / nColumns) * nLen), + Size(nLen, nLen))); + + Update(); +} + +IMPL_LINK( SmShowSymbolSet, ScrollHdl, ScrollBar*, pScrollBar) +{ + Invalidate(); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +void SmShowSymbol::Paint(const Rectangle&) +{ + const XubString &rText = GetText(); + Size aTextSize(GetTextWidth(rText), GetTextHeight()); + + DrawText(Point((GetOutputSize().Width() - aTextSize.Width()) / 2, + (GetOutputSize().Height() - aTextSize.Height()) / 2), rText); +} + + +void SmShowSymbol::MouseButtonDown(const MouseEvent& rMEvt) +{ + if (rMEvt.GetClicks() > 1) + aDblClickHdlLink.Call(this); + else + Control::MouseButtonDown (rMEvt); +} + + +void SmShowSymbol::SetSymbol(const SmSym *pSymbol) +{ + if (pSymbol) + { + Font aFont (pSymbol->GetFace()); + aFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); + SetFont(aFont); + + SetText(XubString(pSymbol->GetCharacter())); + } + + // 'Invalidate' füllt den background mit der background-Farbe. + // Falls der NULL pointer übergeben wurde reicht dies also zum löschen + // der Anzeige + Invalidate(); +} + +//////////////////////////////////////////////////////////////////////////////// + +void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) + // füllt die Einträge der möglichen 'SymbolsSet's im Dialog mit den + // aktuellen Werten des SymbolSet Managers, selektiert aber keinen. +{ + aSymbolSets.Clear(); + if (bDeleteText) + aSymbolSets.SetNoSelection(); + + USHORT nNumSymSets = rSymSetMgr.GetCount(); + for (USHORT i = 0; i < nNumSymSets; i++) + aSymbolSets.InsertEntry(rSymSetMgr.GetSymbolSet(i)->GetName()); +} + + +IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, pListBox ) +{ + DBG_ASSERT(pListBox == &aSymbolSets, "Sm : falsches Argument"); + + SelectSymbolSet(aSymbolSets.GetSelectEntry()); + return 0; +} + + +IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, pShowSymbolSet ) +{ + DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); + + SelectSymbol(aSymbolSetDisplay.GetSelectSymbol()); + return 0; +} + +IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aEditBtn, "Sm : falsches Argument"); + + SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, rSymSetMgr); + + // aktuelles Symbol und SymbolSet am neuen Dialog setzen + const XubString aSymSetName (aSymbolSets.GetSelectEntry()), + aSymName (aSymbolName.GetText()); + pDialog->SelectOldSymbolSet(aSymSetName); + pDialog->SelectOldSymbol(aSymName); + pDialog->SelectSymbolSet(aSymSetName); + pDialog->SelectSymbol(aSymName); + + // altes SymbolSet merken + XubString aOldSymbolSet (aSymbolSets.GetSelectEntry()); + + // Dialog an evtl geänderte Daten des SymbolSet Manager anpassen + if (pDialog->Execute() == RET_OK && rSymSetMgr.IsModified()) + FillSymbolSets(); + + // wenn das alte SymbolSet nicht mehr existiert zum ersten gehen + // (soweit eines vorhanden ist) + if (!SelectSymbolSet(aOldSymbolSet) && aSymbolSets.GetEntryCount() > 0) + SelectSymbolSet(aSymbolSets.GetEntry(0)); + + delete pDialog; + return 0; +} + + +IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, pShowSymbolSet ) +{ + DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); + + GetClickHdl(&aGetBtn); + EndDialog(RET_OK); + return 0; +} + + +IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aGetBtn, "Sm : falscher Button"); + + const SmSym *pSym = GetSymbol(); + if (pSym) + { + XubString aText ('%'); + aText += pSym->GetName(); + + SmViewShell *pViewSh = SmGetActiveView(); + if (pViewSh) + pViewSh->GetViewFrame()->GetDispatcher()->Execute( + SID_INSERTTEXT, SFX_CALLMODE_STANDARD, + new SfxStringItem(SID_INSERTTEXT, aText), 0L); + } + + return 0; +} + + +IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aCloseBtn, "Sm : falscher Button"); + + EndDialog(TRUE); + return 0; +} +IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) + + +SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFreeRes) : + ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), + aSymbolSetText (this, ResId(1)), + aSymbolSets (this, ResId(1)), + aSymbolSetDisplay (this, ResId(1)), + aGrpBox (this, ResId(1)), + aSymbolName (this, ResId(2)), + aSymbolDisplay (this, ResId(2)), + aCloseBtn (this, ResId(3)), + aEditBtn (this, ResId(1)), + aGetBtn (this, ResId(2)), + rSymSetMgr (rMgr) +{ + if (bFreeRes) + FreeResource(); + + pSymSet = NULL; + FillSymbolSets(); + if (aSymbolSets.GetEntryCount() > 0) + SelectSymbolSet(aSymbolSets.GetEntry(0)); + + // set background color to white + Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); + aSymbolDisplay .SetBackground( aWhiteWall ); + aSymbolSetDisplay.SetBackground( aWhiteWall ); + + aSymbolSets .SetSelectHdl (LINK(this, SmSymbolDialog, SymbolSetChangeHdl)); + aSymbolSetDisplay.SetSelectHdl (LINK(this, SmSymbolDialog, SymbolChangeHdl)); + aSymbolSetDisplay.SetDblClickHdl(LINK(this, SmSymbolDialog, SymbolDblClickHdl)); + aSymbolDisplay .SetDblClickHdl(LINK(this, SmSymbolDialog, SymbolDblClickHdl)); + aCloseBtn .SetClickHdl (LINK(this, SmSymbolDialog, CloseClickHdl)); + aEditBtn .SetClickHdl (LINK(this, SmSymbolDialog, EditClickHdl)); + aGetBtn .SetClickHdl (LINK(this, SmSymbolDialog, GetClickHdl)); +} + + +BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName) +{ + BOOL bRet = FALSE; + USHORT nPos = aSymbolSets.GetEntryPos(rSymbolSetName); + + pSymSet = NULL; + if (nPos != LISTBOX_ENTRY_NOTFOUND) + { + aSymbolSets.SelectEntryPos(nPos); + USHORT nSymbolSetNo = rSymSetMgr.GetSymbolSetPos(aSymbolSets.GetSelectEntry()); + pSymSet = rSymSetMgr.GetSymbolSet(nSymbolSetNo); + DBG_ASSERT(pSymSet, "Sm : NULL pointer"); + + aSymbolSetDisplay.SetSymbolSet(*pSymSet); + if (pSymSet->GetCount() > 0) + SelectSymbol(0); + + bRet = TRUE; + } + else + aSymbolSets.SetNoSelection(); + + return bRet; +} + + +void SmSymbolDialog::SelectSymbol(USHORT nSymbolNo) +{ + const SmSym *pSym = NULL; + if (pSymSet && nSymbolNo < pSymSet->GetCount()) + pSym = &pSymSet->GetSymbol(nSymbolNo); + + aSymbolSetDisplay.SelectSymbol(nSymbolNo); + aSymbolDisplay.SetSymbol(pSym); + aSymbolName.SetText(pSym ? pSym->GetName() : XubString()); +} + + +const SmSym * SmSymbolDialog::GetSymbol() const +{ + USHORT nSymbolNo = aSymbolSetDisplay.GetSelectSymbol(); + return pSymSet == NULL ? NULL : &pSymSet->GetSymbol(nSymbolNo); +} + + +/**************************************************************************/ + + +void SmShowCharset::Paint(const Rectangle&) +{ + Size OutputSize = GetOutputSizePixel(); + + int i; + for (i = 1; i < (int) nColumns; i++) + { + int nLenI = nLen * i; + + DrawLine(Point(nLenI, 0), Point(nLenI, OutputSize.Height())); + } + + for (i = 1; i < (int) nRows; i++) + { + int nLenI = nLen * i; + + DrawLine(Point(0, nLenI), Point(OutputSize.Width(), nLenI)); + } + + for (i = 1; i < 256; i++) + { + int x = (i % nColumns) * nLen; + int y = (i / nColumns) * nLen; + + Size aTextSize(GetTextWidth(aChar), GetTextHeight()); + + XubString aChar((xub_Unicode) i); + DrawText(Point(x + (nLen - aTextSize.Width()) / 2, + y + (nLen - aTextSize.Height()) / 2), aChar); + } +} + + +void SmShowCharset::MouseButtonDown(const MouseEvent& rMEvt) +{ + if (rMEvt.IsLeft()) + { + GrabFocus(); + + USHORT n = (USHORT) ((rMEvt.GetPosPixel().Y() / nLen) * nColumns + + (rMEvt.GetPosPixel().X() / nLen)); + SelectChar((xub_Unicode)Min((USHORT) n, (USHORT) 255)); + + aSelectHdlLink.Call(this); + + if (rMEvt.GetClicks() > 1) + aDblClickHdlLink.Call(this); + } + else Control::MouseButtonDown (rMEvt); +} + + +void SmShowCharset::KeyInput(const KeyEvent& rKEvt) +{ + xub_Unicode n = aChar; + + switch (rKEvt.GetKeyCode().GetCode()) + { + case KEY_DOWN: n += (xub_Unicode) nColumns; break; + case KEY_UP: n -= (xub_Unicode) nColumns; break; + case KEY_LEFT: n -= 1; break; + case KEY_RIGHT: n += 1; break; + case KEY_HOME: n = 0; break; + case KEY_END: n = (xub_Unicode) 255; break; + case KEY_PAGEUP: n -= (xub_Unicode) nColumns; break; + case KEY_PAGEDOWN: n += (xub_Unicode) nColumns; break; + + default: + Control::KeyInput(rKEvt); + return; + } + + SelectChar(n); + aSelectHdlLink.Call(this); +} + + +SmShowCharset::SmShowCharset(Window *pParent, const ResId& rResId) : + Control(pParent, rResId) +{ + aChar = xub_Unicode('\0'); + + Size aOutputSize (GetOutputSizePixel()); + + nColumns = 32; + nRows = 8; + + // FontSize passend wählen + nLen = Min(aOutputSize.Width() / nColumns, aOutputSize.Height() / nRows); + + // Fenster genau passend machen (wird höchstens kleiner!) + aOutputSize.Width() = nColumns * nLen; + aOutputSize.Height() = nRows * nLen; + + SetOutputSizePixel(aOutputSize); +} + + +void SmShowCharset::SetFont(const Font &rFont) +{ + Font aFont (rFont); + + // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben + // (hofentlich auch genug für links und rechts) + aFont.SetSize(Size(0, nLen - (nLen / 3))); + aFont.SetTransparent(TRUE); + Control::SetFont(aFont); + + Invalidate(); +} + + +void SmShowCharset::SelectChar(xub_Unicode aCharP) +{ + int c = aChar & 0xFF; + Size aNSize (nLen, nLen); + + Invalidate(Rectangle(Point((c % nColumns) * nLen, (c / nColumns) * nLen), aNSize)); + + aChar = aCharP; + c = aChar & 0xFF; + Invalidate(Rectangle(Point((c % nColumns) * nLen, (c / nColumns) * nLen), aNSize)); + + Update(); +} + + +//////////////////////////////////////////////////////////////////////////////// + + +void SmShowChar::Paint(const Rectangle&) +{ + XubString Text (GetText ()); + + if (Text.Len() > 0) + { + Size aTextSize(GetTextWidth(Text), GetTextHeight()); + + DrawText(Point((GetOutputSize().Width() - aTextSize.Width()) / 2, + (GetOutputSize().Height() - aTextSize.Height()) / 2), Text); + } +} + + +void SmShowChar::SetChar(xub_Unicode aChar) +{ + SetText(XubString(aChar)); + Invalidate(); +} + + +void SmShowChar::SetFont(const Font &rFont) +{ + Font aFont (rFont); + Size aSize (Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); + + aFont.SetSize(aSize); + aFont.SetTransparent(TRUE); + Control::SetFont(aFont); + + Invalidate(); +} + +//////////////////////////////////////////////////////////////////////////////// + +void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, BOOL bDeleteText) +{ + DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, + "Sm : falsche ComboBox"); + + rComboBox.Clear(); + if (bDeleteText) + rComboBox.SetText(XubString()); + + ComboBox &rSymbolSets = &rComboBox == &aOldSymbols ? + aOldSymbolSets : aSymbolSets; + const SmSymSet *pSymSet = GetSymbolSet(rSymbolSets); + if (pSymSet) + { USHORT nNumSymbols = pSymSet->GetCount(); + for (USHORT i = 0; i < nNumSymbols; i++) + rComboBox.InsertEntry(pSymSet->GetSymbol(i).GetName()); + } + +} + + +void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText) +{ + DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, + "Sm : falsche ComboBox"); + + rComboBox.Clear(); + if (bDeleteText) + rComboBox.SetText(XubString()); + + USHORT nNumSymSets = aSymSetMgrCopy.GetCount(); + for (USHORT i = 0; i < nNumSymSets; i++) + rComboBox.InsertEntry(aSymSetMgrCopy.GetSymbolSet(i)->GetName()); +} + + +void SmSymDefineDialog::FillFonts(BOOL bDelete) +{ + aFonts.Clear(); + if (bDelete) + aFonts.SetNoSelection(); + + // alle Fonts der 'FontList' in die Fontliste aufnehmen + // von denen mit gleichen Namen jedoch nur einen (denn der Style wird + // über die 'FontStyleBox' gewählt und nicht auch noch hier) + DBG_ASSERT(pFontList, "Sm : NULL pointer"); + USHORT nCount = pFontList->GetFontNameCount(); + for (USHORT i = 0; i < nCount; i++) + aFonts.InsertEntry( pFontList->GetFontName(i).GetName() ); +} + + +void SmSymDefineDialog::FillStyles(BOOL bDeleteText) +{ + aStyles.Clear(); + if (bDeleteText) + aStyles.SetText(XubString()); + + XubString aText (aFonts.GetSelectEntry()); + if (aText.Len() != 0) + { + //aStyles.Fill(aText, &aFontList); + // eigene StyleName's verwenden + for (USHORT i = 0; i < aStyleNameCount; i++) + aStyles.InsertEntry( aStyleName[i] ); + + DBG_ASSERT(aStyles.GetEntryCount() > 0, "Sm : keine Styles vorhanden"); + aStyles.SetText( aStyles.GetEntry(0) ); + } +} + + +SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox) +{ + DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, + "Sm : falsche ComboBox"); + + USHORT nSymbolSetNo = aSymSetMgrCopy.GetSymbolSetPos(rComboBox.GetText()); + + return nSymbolSetNo == SYMBOLSET_NONE ? + NULL : aSymSetMgrCopy.GetSymbolSet(nSymbolSetNo); +} + + +SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) +{ + DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, + "Sm : falsche ComboBox"); + + return aSymSetMgrCopy.GetSymbol(rComboBox.GetText()); +} + + +IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, pComboBox ) +{ + DBG_ASSERT(pComboBox == &aOldSymbols, "Sm : falsches Argument"); + SelectSymbol(aOldSymbols, aOldSymbols.GetText(), FALSE); + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, pComboBox ) +{ + DBG_ASSERT(pComboBox == &aOldSymbolSets, "Sm : falsches Argument"); + SelectSymbolSet(aOldSymbolSets, aOldSymbolSets.GetText(), FALSE); + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) +{ + // merken der Cursorposition zum wiederherstellen derselben + Selection aSelection (pComboBox->GetSelection()); + + if (pComboBox == &aSymbols) + SelectSymbol(aSymbols, aSymbols.GetText(), FALSE); + else if (pComboBox == &aSymbolSets) + SelectSymbolSet(aSymbolSets, aSymbolSets.GetText(), FALSE); + else if (pComboBox == &aOldSymbols) + // nur Namen aus der Liste erlauben + SelectSymbol(aOldSymbols, aOldSymbols.GetText(), TRUE); + else if (pComboBox == &aOldSymbolSets) + // nur Namen aus der Liste erlauben + SelectSymbolSet(aOldSymbolSets, aOldSymbolSets.GetText(), TRUE); + else if (pComboBox == &aStyles) + // nur Namen aus der Liste erlauben (ist hier eh immer der Fall) + SelectStyle(aStyles.GetText(), TRUE); + else + DBG_ASSERT(0, "Sm : falsche ComboBox Argument"); + + pComboBox->SetSelection(aSelection); + + UpdateButtons(); + + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, pListBox ) +{ + DBG_ASSERT(pListBox == &aFonts, "Sm : falsches Argument"); + + SelectFont(aFonts.GetSelectEntry()); + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) +{ + DBG_ASSERT(pComboBox == &aStyles, "Sm : falsches Argument"); + + SelectStyle(aStyles.GetText()); + return 0; +} + + +IMPL_LINK_INLINE_START( SmSymDefineDialog, CharSelectHdl, SmShowCharset *, pShowCharset ) +{ + DBG_ASSERT(pShowCharset == &aCharsetDisplay, "Sm : falsches Argument"); + + SelectChar(aCharsetDisplay.GetSelectChar()); + return 0; +} +IMPL_LINK_INLINE_END( SmSymDefineDialog, CharSelectHdl, SmShowCharset *, pShowCharset ) + + +IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aAddBtn, "Sm : falsches Argument"); + DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + + SmSymSet *pSymSet = GetSymbolSet(aSymbolSets); + + // SymbolSet einfügen falls es noch nicht existiert + if (!pSymSet) + { + pSymSet = new SmSymSet(aSymbolSets.GetText()); + aSymSetMgrCopy.AddSymbolSet(pSymSet); + FillSymbolSets(aOldSymbolSets, FALSE); + FillSymbolSets(aSymbolSets, FALSE); + } + DBG_ASSERT(pSymSet, "Sm : NULL pointer"); + + // Symbol ins SymbolSet einfügen + SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(), + aCharsetDisplay.GetSelectChar()); + pSymSet->AddSymbol(pSym); + + // update der Hash Tabelle erzwingen (damit aAddBtn disabled wird). + // (wird später nach Überarbeitung von symbol.cxx überflüssig werden). + aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); + + // Symbolliste aktualiseren + FillSymbols(aOldSymbols ,FALSE); + FillSymbols(aSymbols ,FALSE); + + UpdateButtons(); + + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aChangeBtn, "Sm : falsches Argument"); + DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + + // finden des SymbolSets zum alten Symbol + SmSymSet *pOldSymSet = GetSymbolSet(aOldSymbolSets); + DBG_ASSERT(pOldSymSet, "Sm : NULL pointer"); + + // suchen des neuen SymbolSets + SmSymSet *pNewSymSet = GetSymbolSet(aSymbolSets); + // SymbolSet einfügen falls es noch nicht existiert + if (!pNewSymSet) + { + pNewSymSet = new SmSymSet(aSymbolSets.GetText()); + aSymSetMgrCopy.AddSymbolSet(pNewSymSet); + FillSymbolSets(aOldSymbolSets, FALSE); + FillSymbolSets(aSymbolSets, FALSE); + } + + // das (alte) Symbol besorgen + USHORT nSymbol = pOldSymSet->GetSymbolPos(aOldSymbols.GetText()); + SmSym *pSym = (SmSym *) &pOldSymSet->GetSymbol(nSymbol); + DBG_ASSERT(pSym, "Sm : NULL pointer"); + + // Änderungen durchführen; + pSym->GetName() = aSymbols.GetText(); + pSym->GetFace() = aCharsetDisplay.GetFont(); + pSym->GetCharacter() = aCharsetDisplay.GetSelectChar(); + + // das SymbolSet wechseln wenn nötig + if (pOldSymSet != pNewSymSet) + { + pOldSymSet->RemoveSymbol(nSymbol); + pNewSymSet->AddSymbol(pSym); + } + + //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, + //!! um mit möglich neuen bzw fehlenden alten Symbol Namen konform zu sein. + aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); + + UpdateButtons(); + + return 0; +} + + +IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) +{ + DBG_ASSERT(pButton == &aDeleteBtn, "Sm : falsches Argument"); + DBG_ASSERT(aDeleteBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + + if (pOrigSymbol) + { + // löschen des Symbols: + // + // zugehöriges SymbolSet finden + SmSymSet *pSymSet = GetSymbolSet(aOldSymbolSets); + DBG_ASSERT(pSymSet, "Sm : NULL pointer"); + // finden des Index + XubString aOldSymbolName (pOrigSymbol->GetName()); + USHORT nSymbolNo = pSymSet->GetSymbolPos(aOldSymbolName); + DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol"); + // Bezüge auf das Symbols löschen + DBG_ASSERT(pOrigSymbol == &pSymSet->GetSymbol(nSymbolNo), + "Sm : Fehler beim löschen des Symbols"); + SetOrigSymbol(NULL, XubString()); + // und weg mit dem Symbol + pSymSet->DeleteSymbol(nSymbolNo); + + //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, + //!! was er nämlich nicht tut, wenn in einem seiner SymbolSets geändert/ + //!! gelöscht wird, was wiederum zu einem Absturz führen kann (wenn er + //!! über ein nicht mehr existentes aber nicht entferntes Symbol iteriert). + aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); + + // aktualisieren der Symboleinträge des Dialogs + aOldSymbols.SetText(XubString()); + aOldSymbols.RemoveEntry(aOldSymbolName); + if (aSymbolSets.GetText() == aOldSymbolSets.GetText()) + aSymbols.RemoveEntry(aOldSymbolName); + } + + UpdateButtons(); + + return 0; +} + + +void SmSymDefineDialog::UpdateButtons() +{ + BOOL bAdd = FALSE, + bChange = FALSE, + bDelete = FALSE, + bEqual; + XubString aSymbolName (aSymbols.GetText()), + aSymbolSetName (aSymbolSets.GetText()); + + if (aSymbolName.Len() > 0 && aSymbolSetName.Len() > 0) + { + // alle Einstellungen gleich? + //! (Font-, Style- und SymbolSet Name werden nicht case sensitiv verglichen) + bEqual = pOrigSymbol + && aSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) + && aSymbolName.Equals(pOrigSymbol->GetName()) + && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii(pOrigSymbol->GetFace().GetName()) + && aStyles.GetText().EqualsIgnoreCaseAscii(GetFontStyleName(pOrigSymbol->GetFace())) + && aCharsetDisplay.GetSelectChar() == pOrigSymbol->GetCharacter(); + + // hinzufügen nur wenn es noch kein Symbol desgleichen Namens gibt + bAdd = aSymSetMgrCopy.GetSymbol(aSymbolName) == NULL; + + // löschen nur wenn alle Einstellungen gleich sind + bDelete = pOrigSymbol != NULL; + + // ändern wenn bei gleichem Namen mindestens eine Einstellung anders ist + // oder wenn es noch kein Symbol des neuen Namens gibt (würde implizites + // löschen des bereits vorhandenen Symbols erfordern) + BOOL bEqualName = pOrigSymbol && aSymbolName == pOrigSymbol->GetName(); + bChange = pOrigSymbol && (bEqualName && !bEqual || !bEqualName && bAdd); + } + + aAddBtn .Enable(bAdd); + aChangeBtn.Enable(bChange); + aDeleteBtn.Enable(bDelete); +} + + +SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BOOL bFreeRes) : + ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), + aOldSymbolText (this, ResId(1)), + aOldSymbols (this, ResId(1)), + aOldSymbolSetText (this, ResId(2)), + aOldSymbolSets (this, ResId(2)), + aCharsetDisplay (this, ResId(1)), + aSymbolText (this, ResId(9)), + aSymbols (this, ResId(4)), + aSymbolSetText (this, ResId(10)), + aSymbolSets (this, ResId(5)), + aFontText (this, ResId(3)), + aFonts (this, ResId(1)), + aStyleText (this, ResId(4)), + aStyles (this, ResId(3)), + aOldSymbolName (this, ResId(7)), + aOldSymbolDisplay (this, ResId(3)), + aOldSymbolSetName (this, ResId(8)), + aSymbolName (this, ResId(5)), + aSymbolDisplay (this, ResId(2)), + aSymbolSetName (this, ResId(6)), + aAddBtn (this, ResId(1)), + aChangeBtn (this, ResId(2)), + aDeleteBtn (this, ResId(3)), + aOkBtn (this, ResId(1)), + aCancelBtn (this, ResId(1)), + aRightArrow (this, ResId(1)), + pFontList (NULL), + rSymSetMgr (rMgr) +{ + if (bFreeRes) + FreeResource(); + + // get FontList from printer (if possible), otherwise from application window + SmViewShell *pView = SmGetActiveView(); + DBG_ASSERT(pView, "Sm : NULL pointer"); + OutputDevice *pDev = pView->GetDoc()->GetPrinter(); + if (!pDev || pDev->GetDevFontCount() == 0) + pDev = &pView->GetGraphicWindow(); + pFontList = new FontList(pDev); + + + pOrigSymbol = 0; + + // make autocompletion for symbols case-sensitive + aOldSymbols.EnableAutocomplete(TRUE, TRUE); + aSymbols .EnableAutocomplete(TRUE, TRUE); + + FillFonts(); + if (aFonts.GetEntryCount() > 0) + SelectFont(aFonts.GetEntry(0)); + + // set background color to white + Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); + aCharsetDisplay .SetBackground( aWhiteWall ); + aOldSymbolDisplay.SetBackground( aWhiteWall ); + aOldSymbolDisplay.SetBackground( aWhiteWall ); + + SetSymbolSetManager(rSymSetMgr); + + aOldSymbols .SetSelectHdl(LINK(this, SmSymDefineDialog, OldSymbolChangeHdl)); + aOldSymbolSets .SetSelectHdl(LINK(this, SmSymDefineDialog, OldSymbolSetChangeHdl)); + aSymbolSets .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); + aOldSymbolSets .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); + aSymbols .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); + aOldSymbols .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); + aStyles .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); + aFonts .SetSelectHdl(LINK(this, SmSymDefineDialog, FontChangeHdl)); + aStyles .SetSelectHdl(LINK(this, SmSymDefineDialog, StyleChangeHdl)); + aAddBtn .SetClickHdl (LINK(this, SmSymDefineDialog, AddClickHdl)); + aChangeBtn .SetClickHdl (LINK(this, SmSymDefineDialog, ChangeClickHdl)); + aDeleteBtn .SetClickHdl (LINK(this, SmSymDefineDialog, DeleteClickHdl)); + aCharsetDisplay.SetSelectHdl(LINK(this, SmSymDefineDialog, CharSelectHdl)); +} + + +SmSymDefineDialog::~SmSymDefineDialog() +{ + delete pFontList; +} + + +short SmSymDefineDialog::Execute() +{ + short nResult = ModalDialog::Execute(); + + // Änderungen übernehmen falls Dialog mit OK beendet wurde + if (aSymSetMgrCopy.IsModified() && nResult == RET_OK) + { + // leere SymbolSets aus dem Ergebnis entfernen. + // Dabei von hinten durch das array iterieren, da beim löschen die + // Elemente aufrücken. + USHORT nSymbolSets = aSymSetMgrCopy.GetCount(); + for (int i = nSymbolSets - 1; i >= 0; i--) + if (aSymSetMgrCopy.GetSymbolSet(i)->GetCount() == 0) + aSymSetMgrCopy.DeleteSymbolSet(i); + + rSymSetMgr = aSymSetMgrCopy; + } + + return nResult; +} + + +void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr) +{ + aSymSetMgrCopy = rMgr; + + // Das modified Flag der Kopie auf FALSE setzen, damit man später damit + // testen kann ob sich was geändert hat. + aSymSetMgrCopy.SetModified(FALSE); + + FillSymbolSets(aOldSymbolSets); + if (aOldSymbolSets.GetEntryCount() > 0) + SelectSymbolSet(aOldSymbolSets.GetEntry(0)); + FillSymbolSets(aSymbolSets); + if (aSymbolSets.GetEntryCount() > 0) + SelectSymbolSet(aSymbolSets.GetEntry(0)); + FillSymbols(aOldSymbols); + if (aOldSymbols.GetEntryCount() > 0) + SelectSymbol(aOldSymbols.GetEntry(0)); + FillSymbols(aSymbols); + if (aSymbols.GetEntryCount() > 0) + SelectSymbol(aSymbols.GetEntry(0)); + + UpdateButtons(); +} + + +BOOL SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, + const XubString &rSymbolSetName, BOOL bDeleteText) +{ + DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, + "Sm : falsche ComboBox"); + + // 'Normalisieren' des SymbolNamens (ohne leading und trailing Leerzeichen) + XubString aNormName (rSymbolSetName); + aNormName.EraseLeadingChars(' '); + aNormName.EraseTrailingChars(' '); + // und evtl Abweichungen in der Eingabe beseitigen + rComboBox.SetText(aNormName); + + BOOL bRet = FALSE; + USHORT nPos = rComboBox.GetEntryPos(aNormName); + + if (nPos != COMBOBOX_ENTRY_NOTFOUND) + { + rComboBox.SetText(rComboBox.GetEntry(nPos)); + bRet = TRUE; + } + else if (bDeleteText) + rComboBox.SetText(XubString()); + + BOOL bIsOld = &rComboBox == &aOldSymbolSets; + + // setzen des SymbolSet Namens an der zugehörigen Darstellung + FixedText &rFT = bIsOld ? aOldSymbolSetName : aSymbolSetName; + rFT.SetText(rComboBox.GetText()); + + // setzen der zum SymbolSet gehörenden Symbol Namen an der zugehörigen + // Auswahbox + ComboBox &rCB = bIsOld ? aOldSymbols : aSymbols; + FillSymbols(rCB, FALSE); + + // bei Wechsel des SymbolSets für das alte Zeichen ein gültiges + // Symbol bzw keins zur Anzeige bringen + if (bIsOld) + { + XubString aOldSymbolName; + if (aOldSymbols.GetEntryCount() > 0) + aOldSymbolName = aOldSymbols.GetEntry(0); + SelectSymbol(aOldSymbols, aOldSymbolName, TRUE); + } + + UpdateButtons(); + + return bRet; +} + + +void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, + const XubString &rSymbolSetName) +{ + pOrigSymbol = pSymbol; + + XubString aSymName, + aSymSetName; + if (pSymbol) + { + aSymName = pSymbol->GetName(); + aSymSetName = rSymbolSetName; + aOldSymbolDisplay.SetFont(pSymbol->GetFace()); + aOldSymbolDisplay.SetChar(pSymbol->GetCharacter()); + } + else + { // löschen des angezeigten Symbols + aOldSymbolDisplay.SetText(XubString()); + aOldSymbolDisplay.Invalidate(); + } + aOldSymbolName .SetText(aSymName); + aOldSymbolSetName.SetText(aSymSetName); +} + + +BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, + const XubString &rSymbolName, BOOL bDeleteText) +{ + DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, + "Sm : falsche ComboBox"); + + // 'Normalisieren' des SymbolNamens (ohne Leerzeichen) + XubString aNormName (rSymbolName); + aNormName.EraseAllChars(' '); + // und evtl Abweichungen in der Eingabe beseitigen + rComboBox.SetText(aNormName); + + BOOL bRet = FALSE; + USHORT nPos = rComboBox.GetEntryPos(aNormName); + + BOOL bIsOld = &rComboBox == &aOldSymbols; + + if (nPos != COMBOBOX_ENTRY_NOTFOUND) + { + rComboBox.SetText(rComboBox.GetEntry(nPos)); + + if (!bIsOld) + { + const SmSym *pSymbol = GetSymbol(aSymbols); + if (pSymbol) + { + // Font und Style entsprechend wählen + const Font &rFont = pSymbol->GetFace(); + SelectFont(rFont.GetName(), FALSE); + SelectStyle(GetFontStyleName(rFont), FALSE); + + // da das setzen des Fonts über den Style Namen des SymbolsFonts nicht + // so gut klappt (er kann zB leer sein obwohl der Font selbst 'bold' und + // 'italic' ist!). Setzen wir hier den Font wie er zum Symbol gehört + // zu Fuß. + aCharsetDisplay.SetFont(rFont); + aSymbolDisplay.SetFont(rFont); + + // das zugehörige Zeichen auswählen + SelectChar(pSymbol->GetCharacter()); + } + } + + bRet = TRUE; + } + else if (bDeleteText) + rComboBox.SetText(XubString()); + + if (bIsOld) + { + // bei Wechsel des alten Symbols nur vorhandene anzeigen sonst keins + const SmSym *pOldSymbol = NULL; + XubString aOldSymbolSetName; + if (nPos != COMBOBOX_ENTRY_NOTFOUND) + { + pOldSymbol = aSymSetMgrCopy.GetSymbol(aNormName); + aOldSymbolSetName = aOldSymbolSets.GetText(); + } + SetOrigSymbol(pOldSymbol, aOldSymbolSetName); + } + else + aSymbolName.SetText(rComboBox.GetText()); + + UpdateButtons(); + + return bRet; +} + + +void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rStyleName) +{ + // Font (FontInfo) passend zu Namen und Style holen + DBG_ASSERT(pFontList, "Sm : NULL pointer"); + FontInfo aFI( pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE) ); + SetFontStyle(rStyleName, aFI); + + aCharsetDisplay.SetFont(aFI); + aSymbolDisplay.SetFont(aFI); +} + + +BOOL SmSymDefineDialog::SelectFont(const XubString &rFontName, BOOL bApplyFont) +{ + BOOL bRet = FALSE; + USHORT nPos = aFonts.GetEntryPos(rFontName); + + if (nPos != LISTBOX_ENTRY_NOTFOUND) + { + aFonts.SelectEntryPos(nPos); + if (aStyles.GetEntryCount() > 0) + SelectStyle(aStyles.GetEntry(0)); + if (bApplyFont) + SetFont(aFonts.GetSelectEntry(), aStyles.GetText()); + bRet = TRUE; + } + else + aFonts.SetNoSelection(); + FillStyles(); + + UpdateButtons(); + + return bRet; +} + + +BOOL SmSymDefineDialog::SelectStyle(const XubString &rStyleName, BOOL bApplyFont) +{ + BOOL bRet = FALSE; + USHORT nPos = aStyles.GetEntryPos(rStyleName); + + // falls der Style nicht zur Auswahl steht nehmen wir den erst möglichen + // (sofern vorhanden) + if (nPos == COMBOBOX_ENTRY_NOTFOUND && aStyles.GetEntryCount() > 0) + nPos = 0; + + if (nPos != COMBOBOX_ENTRY_NOTFOUND) + { + aStyles.SetText(aStyles.GetEntry(nPos)); + if (bApplyFont) + SetFont(aFonts.GetSelectEntry(), aStyles.GetText()); + bRet = TRUE; + } + else + aStyles.SetText(XubString()); + + UpdateButtons(); + + return bRet; +} + + +void SmSymDefineDialog::SelectChar(xub_Unicode cChar) +{ + aCharsetDisplay.SelectChar(cChar); + aSymbolDisplay.SetChar(cChar); + + UpdateButtons(); +} + + +/**************************************************************************/ + +#ifdef NEVER +SfxTabPage* SmGeneralTabPage::Create(Window* pWindow, const SfxItemSet& rSet) +{ + return new SmGeneralTabPage(pWindow, rSet); +} +#endif NEVER + + + -- cgit v1.2.3 From d7c5edaeec78062a58503aba5b93f69bae995190 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 16 Oct 2000 09:58:40 +0000 Subject: #78980# Font modify handler added to allow for Font switch via paste --- starmath/inc/dialog.hxx | 7 ++++--- starmath/source/dialog.cxx | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6a1591c212bb..c227f5fcf610 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * last change: $Author: tl $ $Date: 2000-10-16 10:58:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -238,7 +238,8 @@ class SmFontDialog : public ModalDialog Font Face; - DECL_LINK(FontChangeHdl, ComboBox *); + DECL_LINK(FontSelectHdl, ComboBox *); + DECL_LINK(FontModifyHdl, ComboBox *); DECL_LINK(AttrChangeHdl, CheckBox *); public: diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 056103b3c61b..37fb3840d2c3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:26 $ + * last change: $Author: tl $ $Date: 2000-10-16 10:58:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -381,13 +381,25 @@ void SmShowFont::SetFont(const Font& rFont) } -IMPL_LINK_INLINE_START( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK_INLINE_START( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox ) { Face.SetName(pComboBox->GetText()); aShowFont.SetFont(Face); return 0; } -IMPL_LINK_INLINE_END( SmFontDialog, FontChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK_INLINE_END( SmFontDialog, FontSelectHdl, ComboBox *, pComboBox ) + + +IMPL_LINK( SmFontDialog, FontModifyHdl, ComboBox *, pComboBox ) +{ + // if font is available in list then use it + USHORT nPos = pComboBox->GetEntryPos( pComboBox->GetText() ); + if (COMBOBOX_ENTRY_NOTFOUND != nPos) + { + FontSelectHdl( pComboBox ); + } + return 0; +} IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, pCheckBox ) @@ -463,7 +475,8 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) //Application::LeaveWait(); } - aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontChangeHdl)); + aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontSelectHdl)); + aFontBox.SetModifyHdl(LINK(this, SmFontDialog, FontModifyHdl)); aBoldCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); aItalicCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); } -- cgit v1.2.3 From 394ef93f115cc630ab20fd155efcab5c0f59aec6 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 7 Feb 2001 11:46:52 +0000 Subject: use defines now for resources of the print options TabPage --- starmath/inc/dialog.hxx | 8 ++++---- starmath/source/dialog.cxx | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index c227f5fcf610..301c4e69a05b 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2000-10-16 10:58:22 $ + * last change: $Author: tl $ $Date: 2001-02-07 12:46:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -154,13 +154,13 @@ class SmPrintOptionsTabPage : public SfxTabPage CheckBox aTitle; CheckBox aText; CheckBox aFrame; - GroupBox aGroupBox3; - CheckBox aNoRightSpaces; GroupBox aGroupBox2; RadioButton aSizeNormal; RadioButton aSizeScaled; RadioButton aSizeZoomed; MetricField aZoom; + GroupBox aGroupBox3; + CheckBox aNoRightSpaces; DECL_LINK(SizeButtonClickHdl, Button *); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 37fb3840d2c3..dc37f00b82c7 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2000-10-16 10:58:40 $ + * last change: $Author: tl $ $Date: 2001-02-07 12:46:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,6 +123,9 @@ #ifndef _STARMATH_HRC #include "starmath.hrc" #endif + +#include "dialog.hrc" + #ifndef _SMMOD_HXX #include "smmod.hxx" #endif @@ -221,17 +224,17 @@ IMPL_LINK_INLINE_END( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButt SmPrintOptionsTabPage::SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions) : SfxTabPage(pParent, SmResId(RID_PRINTOPTIONPAGE), rOptions), - aGroupBox1 (this, ResId(1)), - aTitle (this, ResId(1)), - aText (this, ResId(2)), - aFrame (this, ResId(3)), - aGroupBox3 (this, ResId(3)), - aNoRightSpaces (this, ResId(4)), - aGroupBox2 (this, ResId(2)), - aSizeNormal (this, ResId(1)), - aSizeScaled (this, ResId(2)), - aSizeZoomed (this, ResId(3)), - aZoom (this, ResId(1)) + aGroupBox1 (this, ResId( GB_PRINTOPTIONS )), + aTitle (this, ResId( CB_TITLEROW )), + aText (this, ResId( CB_EQUATION_TEXT )), + aFrame (this, ResId( CB_FRAME )), + aGroupBox2 (this, ResId( GB_PRINT_FORMAT )), + aSizeNormal (this, ResId( RB_ORIGINAL_SIZE )), + aSizeScaled (this, ResId( RB_FIT_TO_PAGE )), + aSizeZoomed (this, ResId( RB_ZOOM )), + aZoom (this, ResId( MF_ZOOM )), + aGroupBox3 (this, ResId( GB_MISC_OPTIONS )), + aNoRightSpaces (this, ResId( CB_IGNORE_SPACING )) { FreeResource(); -- cgit v1.2.3 From ecb9bc1488a13a5deec4cfeac86f050da3f4bc1c Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 2 May 2001 15:58:48 +0000 Subject: Math configuration and Symbol/SymbolSet/SymbolSetManager --- starmath/inc/config.hxx | 67 +------ starmath/inc/dialog.hxx | 41 +--- starmath/inc/document.hxx | 5 +- starmath/inc/format.hxx | 14 +- starmath/inc/smmod.hxx | 10 +- starmath/inc/starmath.hrc | 12 +- starmath/inc/symbol.hxx | 99 ++++++---- starmath/sdi/smath.sdi | 23 --- starmath/sdi/smslots.sdi | 14 +- starmath/source/config.cxx | 244 +++--------------------- starmath/source/dialog.cxx | 113 +++-------- starmath/source/document.cxx | 100 ++-------- starmath/source/format.cxx | 39 +++- starmath/source/makefile.mk | 14 +- starmath/source/parse.cxx | 11 +- starmath/source/smdll.cxx | 6 +- starmath/source/smmod.cxx | 29 +-- starmath/source/symbol.cxx | 433 +++++++++++++++++++++++++++---------------- starmath/source/toolbox.cxx | 6 +- starmath/source/view.cxx | 8 +- 20 files changed, 515 insertions(+), 773 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/config.hxx b/starmath/inc/config.hxx index 77b6455ccc7e..ac09e0075bc9 100644 --- a/starmath/inc/config.hxx +++ b/starmath/inc/config.hxx @@ -2,9 +2,9 @@ * * $RCSfile: config.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,8 +75,7 @@ #include "format.hxx" #endif -#define HINT_CONFIGCHANGED 10002 -#define SMCONFIGITEM (SID_SMA_START+1) +#include "cfgitem.hxx" class SmPreferenceDialog; @@ -84,76 +83,18 @@ class SmPrintDialog; class SmPrintOptionDialog; class SfxItemSet; -enum SmPrintSize { PRINT_SIZE_NORMAL, PRINT_SIZE_SCALED, PRINT_SIZE_ZOOMED }; - -class SmConfig : public SfxBroadcaster, public SfxListener, public SfxConfigItem +class SmConfig : public SmMathConfig, public SfxBroadcaster { - String aSymbolFile; - SmFormat aStandardFormat; SmFontPickList vFontPickList[7]; - SmPrintSize ePrintSize; - USHORT nPrintZoom; - - BOOL bPrintTitle, - bPrintText, - bPrintFrame, - bWarnNoSymbols, - bToolBoxVisible, - bCmdBoxWindow, - bAutoRedraw, - bFormulaCursor, - bNoRightSpaces; // ignorieren von ~ und ` am Zeilenende - - virtual void SFX_NOTIFY(SfxBroadcaster &rBC, const TypeId &rBCType, - const SfxHint &rHint, const TypeId &rHintType); - - void ConfigChangedAction(); - void SetValueIfNE(BOOL &rItem, const BOOL bVal); - public: SmConfig(); virtual ~SmConfig(); - virtual int Load (SvStream &rStream); - virtual BOOL Store(SvStream &rStream); - - virtual void UseDefault(); - virtual String GetName() const; - - SmFormat & GetFormat() { return aStandardFormat; } SmFontPickList & GetFontPickList(USHORT nIdent) { return vFontPickList[nIdent]; } - const String & GetSymbolFile() const { return aSymbolFile; } - void SetSymbolFile(const String &rText); - - SmPrintSize GetPrintSize() const { return ePrintSize; } - USHORT GetPrintZoom() const { return nPrintZoom; } - - BOOL IsCmdBoxWindowEnabled() const { return bCmdBoxWindow; } - - BOOL IsPrintTitle() const { return bPrintTitle; } - BOOL IsPrintText() const { return bPrintText; } - BOOL IsPrintFrame() const { return bPrintFrame; } - BOOL IsNoRightSpaces() const { return bNoRightSpaces; } - - BOOL IsToolBoxVisible() const { return bToolBoxVisible; } - void SetToolBoxVisible(BOOL bVal) { SetValueIfNE(bToolBoxVisible, bVal); } - - BOOL IsAutoRedraw() const { return bAutoRedraw; } - void SetAutoRedraw(BOOL bVal) { SetValueIfNE(bAutoRedraw, bVal); } - - BOOL IsWarnNoSymbols() const { return bWarnNoSymbols; } - void SetWarnNoSymbols(BOOL bVal) { SetValueIfNE(bWarnNoSymbols, bVal); } - - BOOL IsShowFormulaCursor() const { return bFormulaCursor; } - void SetShowFormulaCursor(BOOL bVal) { SetValueIfNE(bFormulaCursor, bVal); } - void ItemSetToConfig(const SfxItemSet &rSet); void ConfigToItemSet(SfxItemSet &rSet) const; - - friend SvStream & operator << (SvStream &rStream, const SmConfig &rConfig); - friend SvStream & operator >> (SvStream &rStream, SmConfig &rConfig); }; #endif diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index d6074f056eec..d8458e5a156e 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: os $ $Date: 2001-03-22 14:09:28 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -173,42 +173,6 @@ public: SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions); }; - -#ifdef NEVER -class SmGeneralTabPage : public SvxGeneralTabPage -{ -public : - static SfxTabPage* Create(Window* pWindow, const SfxItemSet& rSet); - - SmGeneralTabPage (Window *pParent, const SfxItemSet &rAttrSet) : - SvxGeneralTabPage (pParent, rAttrSet) - { - } -}; -#endif //NEVER - -/**************************************************************************/ - -#ifdef NEVER -class SmExtraOptionsTabPage : public SfxTabPage -{ - CheckBox aAutoRedraw; - FixedText aFixedText1; - SmInfoText aSymbolFile; - PushButton aBrowseButton; - - DECL_LINK(SymClickHdl, PushButton*); - - virtual BOOL FillItemSet(SfxItemSet& rOutSet); - virtual void Reset(const SfxItemSet& rOutSet); - -public: - SmExtraOptionsTabPage(const SfxItemSet& rInSet, Window *pParent, BOOL bFreeRes = TRUE); - - static SfxTabPage* Create(Window* pWindow, const SfxItemSet& rSet); -}; -#endif //NEVER - /**************************************************************************/ class SmShowFont : public Control @@ -482,6 +446,7 @@ class SmSymbolDialog : public ModalDialog public: SmSymbolDialog(Window * pParent, SmSymSetManager &rSymSetMgr, BOOL bFreeRes = TRUE); + virtual ~SmSymbolDialog(); BOOL SelectSymbolSet(const XubString &rSymbolSetName); void SelectSymbol(USHORT nSymbolNo); diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index bd97d58f3ba2..6dacc372c123 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -2,9 +2,9 @@ * * $RCSfile: document.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tl $ $Date: 2001-04-19 14:44:29 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,7 @@ #endif class SmNode; +class SmSymSetManager; class SfxPrinter; class Printer; diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 8b17d8893fb9..8ff06a603692 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -2,9 +2,9 @@ * * $RCSfile: format.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -162,7 +162,7 @@ public: const SmFace & GetFont(USHORT nIdent) const { return vFont[nIdent]; } SmFace & Font (USHORT nIdent) { return vFont[nIdent]; } - void SetFont(USHORT nIdent, const SmFace &rFont) { vFont[nIdent] = rFont; } + void SetFont(USHORT nIdent, const SmFace &rFont); USHORT GetRelSize(USHORT nIdent) const { return vSize[nIdent]; } void SetRelSize(USHORT nIdent, USHORT nVal) { vSize[nIdent] = nVal;} @@ -186,6 +186,9 @@ public: SmFormat & operator = (const SmFormat &rFormat); + BOOL operator == (const SmFormat &rFormat) const; + inline BOOL operator != (const SmFormat &rFormat) const; + void RequestApplyChanges() const { ((SmFormat *) this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); @@ -199,5 +202,10 @@ public: friend SvStream & operator >> (SvStream &rStream, SmFormat &rFormat); }; +inline BOOL SmFormat::operator != (const SmFormat &rFormat) const +{ + return !(*this == rFormat); +} + #endif diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index a99ca19e654c..42aad1b48388 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -2,9 +2,9 @@ * * $RCSfile: smmod.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:24 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,7 +72,6 @@ class SvxErrorHandler; class SvFactory; class SmConfig; -class SmSymSetManager; class SmModule; /************************************************************************* @@ -92,7 +91,6 @@ class SmRectCache; class SmModule : public SmModuleDummy { SmConfig *pConfig; - SmSymSetManager *pSymSetManager; SmRectCache *pRectCache; virtual void FillStatusBar(StatusBar &rBar); @@ -107,12 +105,10 @@ public: virtual SfxModule * Load(); virtual void Free(); - SmConfig * GetConfig() { return pConfig; } - SmSymSetManager * GetSymSetManager() { return pSymSetManager; } + SmConfig * GetConfig(); SmRectCache * GetRectCache() { return pRectCache; } void GetState(SfxItemSet&); - void InitManager(); //virtuelle Methoden fuer den Optionendialog virtual SfxItemSet* CreateItemSet( USHORT nId ); diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index f44d8ec4abf4..6289624786e4 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -2,9 +2,9 @@ * * $RCSfile: starmath.hrc,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2001-02-06 15:56:00 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,7 +88,7 @@ #define SID_FONTSIZE (SID_SMA_START + 51) #define SID_DISTANCE (SID_SMA_START + 52) #define SID_ALIGN (SID_SMA_START + 53) -#define SID_SYMBOLS_LOAD (SID_SMA_START + 54) + #define SID_AUTO_REDRAW (SID_SMA_START + 55) #define SID_SYMBOLS (SID_SMA_START + 56) // Muss erstmal wieder aufgenommen werden ! #define SID_TEXTMODE (SID_SMA_START + 57) @@ -114,7 +114,7 @@ #define SID_COPYOBJECT (SID_SMA_START + 117) #define SID_PASTEOBJECT (SID_SMA_START + 118) #define SID_AUTOREDRAW (SID_SMA_START + 119) -#define SID_SYMBOLFILE (SID_SMA_START + 120) + #define SID_GETEDITTEXT (SID_SMA_START + 121) #define SID_CMDBOXWINDOW (SID_SMA_START + 122) #define SID_TOOLBOXWINDOW (SID_SMA_START + 123) @@ -450,6 +450,10 @@ #define RID_XPP_OVERBRACE (RID_APP_START + 3022) #define RID_XPP_UNDERBRACE (RID_APP_START + 3023) +#define RID_LOCALIZED_SYMBOL_NAMES (RID_APP_START + 3101) +#define RID_UI_SYMBOL_NAMES (RID_APP_START + 3102) +#define RID_EXPORT_SYMBOL_NAMES (RID_APP_START + 3103) + #define HID_SMA_OPTIONSDIALOG (HID_SMA_START + 1) #define HID_SMA_FONTDIALOG (HID_SMA_START + 2) #define HID_SMA_FONTSIZEDIALOG (HID_SMA_START + 3) diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index d05589acb016..6402ddc70b53 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: cmc $ $Date: 2001-01-18 14:55:58 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,9 @@ #ifndef SYMBOL_HXX #define SYMBOL_HXX +#ifndef _VOS_REFERNCE_HXX_ +#include +#endif #ifndef _FONT_HXX //autogen #include #endif @@ -70,12 +73,16 @@ #ifndef _TOOLS_DEBUG_HXX //autogen #include #endif +#ifndef _DYNARY_HXX +#include +#endif #ifndef _SFXLSTNER_HXX //autogen #include #endif -#ifndef _DYNARY_HXX //autogen -#include +#ifndef _SVARRAY_HXX +#include #endif + #ifndef UTILITY_HXX #include "utility.hxx" #endif @@ -88,25 +95,38 @@ //////////////////////////////////////////////////////////////////////////////// +String GetExportSymbolName( const String &rUiSymbolName ); +String GetUiSymbolName( const String &rExportSymbolName ); + +//////////////////////////////////////////////////////////////////////////////// + class SmSym { friend class SmSymSetManager; + friend SvStream& operator << (SvStream& rStream, const SmSym& rSymbol); + friend SvStream& operator >> (SvStream& rStream, SmSym& rSymbol); + SmFace Face; String Name; + String aExportName; + String aSetName; SmSym *pHashNext; SmSymSetManager *pSymSetManager; sal_Unicode Character; BYTE Attribut; + BOOL bPredefined; + BOOL bDocSymbol; public: SmSym(); SmSym(const SmSym& rSymbol); - SmSym(const String& rName, const Font& rFont, sal_Unicode aChar); + SmSym(const String& rName, const Font& rFont, sal_Unicode cChar, + const String& rSet, BOOL bIsPredefined = FALSE); SmSym& operator = (const SmSym& rSymbol); - void SetSymbolName(const String& rName); + void SetSymbolName(const String& rName); const Font& GetFace() const { return Face; } sal_Unicode GetCharacter() const { return Character; } @@ -116,11 +136,17 @@ public: sal_Unicode& GetCharacter() { return Character; } String& GetName() { return Name; } - friend SvStream& operator << (SvStream& rStream, const SmSym& rSymbol); - friend SvStream& operator >> (SvStream& rStream, SmSym& rSymbol); + BOOL IsPredefined() const { return bPredefined; } + const String & GetSetName() const { return aSetName; } + const String & GetExportName() const { return aExportName; } + void SetExportName( const String &rName ) { aExportName = rName; } + + BOOL IsDocSymbol() const { return bDocSymbol; } + void SetDocSymbol( BOOL bVal ) { bDocSymbol = bVal; } }; DECLARE_LIST(SmListSym, SmSym *); +SV_DECL_PTRARR( SymbolArray, SmSym *, 32, 32 ); /**************************************************************************/ @@ -128,6 +154,9 @@ class SmSymSet { friend class SmSymSetManager; + friend SvStream& operator << (SvStream& rStream, const SmSymSet& rSymbolSet); + friend SvStream& operator >> (SvStream& rStream, SmSymSet& rSymbolSet); + SmListSym SymbolList; String Name; SmSymSetManager *pSymSetManager; @@ -156,9 +185,6 @@ public: void ReplaceSymbol(USHORT SymbolNo, SmSym& rSymbol); SmSym * RemoveSymbol(USHORT SymbolNo); USHORT GetSymbolPos(const String& rName); - - friend SvStream& operator << (SvStream& rStream, const SmSymSet& rSymbolSet); - friend SvStream& operator >> (SvStream& rStream, SmSymSet& rSymbolSet); }; DECLARE_DYNARRAY(SmArraySymSet, SmSymSet *) @@ -167,14 +193,21 @@ DECLARE_DYNARRAY(SmArraySymSet, SmSymSet *) class SmSymbolDialog; -class SmSymSetManager : public SfxListener + +struct SmSymSetManager_Impl { - SmArraySymSet SymbolSets; + SmArraySymSet SymbolSets; String aStreamName; - SmSym **HashEntries; - UINT32 NoSymbolSets; - UINT32 NoHashEntries; - BOOL Modified; + SmSym** HashEntries; + USHORT NoSymbolSets; + USHORT NoHashEntries; + BOOL Modified; +}; + + +class SmSymSetManager : public SfxListener +{ + SmSymSetManager_Impl *pImpl; virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType); @@ -182,24 +215,25 @@ class SmSymSetManager : public SfxListener UINT32 GetHashIndex(const String& rSymbolName); void EnterHashTable(SmSymSet& rSymbolSet); void FillHashTable(); - -public: void Init(); void Exit(); - SmSymSetManager(UINT32 HashTableSize = 137); - SmSymSetManager(const SmSymSetManager& rSymbolSetManager); - ~SmSymSetManager(); +public: + SmSymSetManager(USHORT HashTableSize = 137); + SmSymSetManager(const SmSymSetManager& rSymbolSetManager); + ~SmSymSetManager(); SmSymSetManager& operator = (const SmSymSetManager& rSymbolSetManager); - UINT32 GetCount() const { return NoSymbolSets; } - SmSymSet *GetSymbolSet(USHORT SymbolSetNo) const { return SymbolSets.Get(SymbolSetNo);} - USHORT AddSymbolSet(SmSymSet* pSymbolSet); void ChangeSymbolSet(SmSymSet* pSymbolSet); void DeleteSymbolSet(USHORT SymbolSetNo); USHORT GetSymbolSetPos(const String& rSymbolSetName) const; + USHORT GetSymbolSetCount() const { return pImpl->NoSymbolSets; } + SmSymSet *GetSymbolSet(USHORT SymbolSetNo) const + { + return pImpl->SymbolSets.Get(SymbolSetNo); + } SmSym * GetSymbol(const String& rSymbolName); const SmSym * GetSymbol(const String& rSymbolName) const @@ -207,18 +241,15 @@ public: return ((SmSymSetManager *) this)->GetSymbol(rSymbolName); } - void AppendExtraSymbolSet(SmSymSet* pSymbolSet) {} - void ResetAccessedSymbols() {} - SmSymSet GetAccessedSymbols() { return SmSymSet(); } + void AddReplaceSymbol( const SmSym & rSymbol ); + USHORT GetSymbolCount() const; + const SmSym * GetSymbol( USHORT nPos ) const; - BOOL IsModified() const { return (Modified); } - void SetModified(BOOL Modify) { Modified = Modify; } + BOOL IsModified() const { return pImpl->Modified; } + void SetModified(BOOL Modify) { pImpl->Modified = Modify; } - void Load(const String& rURL); + void Load(); void Save(); - - friend SvStream& operator << (SvStream& rStream, SmSymSetManager& rSymbolSetManager); - friend SvStream& operator >> (SvStream& rStream, SmSymSetManager& rSymbolSetManager); }; #endif diff --git a/starmath/sdi/smath.sdi b/starmath/sdi/smath.sdi index be4e6bc82250..0ac0945e9481 100644 --- a/starmath/sdi/smath.sdi +++ b/starmath/sdi/smath.sdi @@ -533,29 +533,6 @@ SfxVoidItem ChangeFontSize SID_FONTSIZE GroupId = GID_FORMAT; ] -//-------------------------------------------------------------------------- -SfxVoidItem SymbolsLoad SID_SYMBOLS_LOAD -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = TRUE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_OPTIONS; -] - //-------------------------------------------------------------------------- SfxVoidItem SaveSymbols SID_SAVESYMBOLS () diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 3ca9d366cb2f..f081822db6f3 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -5,8 +5,8 @@ #* #* Beschreibung Starmath IDL-File #* -#* Letzte Aenderung $Author: hr $ $Date: 2000-09-18 16:57:26 $ -#* $Revision: 1.1.1.1 $ +#* Letzte Aenderung $Author: tl $ $Date: 2001-05-02 16:58:48 $ +#* $Revision: 1.2 $ #* #* $Logfile: T:/starmath/sdi/smslots.sdv $ #* @@ -16,7 +16,7 @@ Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/starmath/sdi/smslots.sdi,v 1.1.1.1 2000-09-18 16:57:26 hr Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/starmath/sdi/smslots.sdi,v 1.2 2001-05-02 16:58:48 tl Exp $ *************************************************************************/ @@ -70,11 +70,6 @@ interface FormulaDocument : OfficeDocument ExecMethod = Execute ; StateMethod = GetState ; ] - SID_SYMBOLS_LOAD //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] SID_AUTO_REDRAW //idlpp ole : no , status : no [ ExecMethod = Execute ; @@ -323,6 +318,9 @@ shell SmViewShell : SfxViewShell Source Code Control System - History $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 16:57:26 hr + initial import + Revision 1.61 1999/07/02 10:22:24 TL #67357# SID_MARKERROR deleted. diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx index c9d6e566f487..f29769c946db 100644 --- a/starmath/source/config.cxx +++ b/starmath/source/config.cxx @@ -2,9 +2,9 @@ * * $RCSfile: config.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mib $ $Date: 2001-02-06 16:02:19 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,193 +106,59 @@ #include "starmath.hrc" #endif -#define DEFSYMFILE "starmath$(lang).sms" -#define CONFIGVERSION (INT16)0x0001; +///////////////////////////////////////////////////////////////// - -SmConfig::SmConfig() : - SfxConfigItem(SMCONFIGITEM) +SmConfig::SmConfig() { - UseDefault(); - StartListening(aStandardFormat); } SmConfig::~SmConfig() { - EndListening(aStandardFormat); -} - - -void SmConfig::SFX_NOTIFY(SfxBroadcaster &, const TypeId &, - const SfxHint &rHint, const TypeId &) -{ - switch (((SfxSimpleHint &) rHint).GetId()) - { - case HINT_FORMATCHANGED: - SetModified(TRUE); - SetDefault (FALSE); - break; - } -} - - -void SmConfig::ConfigChangedAction() -{ - SetModified(TRUE); - SetDefault(FALSE); - //Broadcast(SfxSimpleHint(HINT_CONFIGCHANGED)); -} - - -void SmConfig::SetValueIfNE(BOOL &rItem, const BOOL bVal) - // "Set 'Modified' and 'Value' if not equal" -{ - if (rItem != bVal) - { rItem = bVal; - ConfigChangedAction(); - } -} - - -void SmConfig::SetSymbolFile(const String &rText) -{ - if (aSymbolFile != rText) - { - aSymbolFile = rText; - ConfigChangedAction(); - } -} - - -int SmConfig::Load(SvStream &rStream) -{ - // Da die Fileformat Version in ConfigItems nur einen Defaultwert hat setzen - // wir diesen hier auf die aktuelle Version, damit beim folgenden (impliziten) - // einlesen des 'SmFormat' Objekts aus dem Stream dieses entsprechend - // reagieren kann. - rStream.SetVersion(SOFFICE_FILEFORMAT_50); - - rStream >> *this; - SetDefault(FALSE); - return SfxConfigItem::ERR_OK; -} - - -BOOL SmConfig::Store(SvStream &rStream) -{ - rStream << *this; - return TRUE; -} - -/**************************************************************************/ - -void SmConfig::UseDefault() -{ - SfxConfigItem::UseDefault(); // this implicitly calls 'SetDefault(TRUE)' - - bToolBoxVisible = bCmdBoxWindow = bAutoRedraw = bFormulaCursor = - bPrintTitle = bPrintText = bPrintFrame = bWarnNoSymbols = - bNoRightSpaces = TRUE; - - aSymbolFile = C2S(DEFSYMFILE); - SvtPathOptions aOpt; - aOpt.SearchFile( aSymbolFile, SvtPathOptions::PATH_USERCONFIG ); - - ePrintSize = PRINT_SIZE_NORMAL; - nPrintZoom = 100; -} - -/**************************************************************************/ - -String SmConfig::GetName() const -{ - return C2S("StarMath"); } -/**************************************************************************/ void SmConfig::ItemSetToConfig(const SfxItemSet &rSet) { const SfxPoolItem *pItem = NULL; - BOOL bModified = FALSE; - String aSymbolFile; - - if (rSet.GetItemState(SID_SYMBOLFILE, TRUE, &pItem) == SFX_ITEM_SET) - { aSymbolFile = ((const SfxStringItem *) pItem)->GetValue(); - DBG_ASSERT(aSymbolFile.Len() > 0, "Symboldatei nicht angegeben !"); - - if (aSymbolFile != aSymbolFile) - { - SfxModule *p = SM_MOD1(); - SmModule *pp = (SmModule *) p; - - pp->GetConfig()->SetWarnNoSymbols(TRUE); - aSymbolFile = aSymbolFile; - - bModified = TRUE; - } - } UINT16 nU16; + BOOL bVal; if (rSet.GetItemState(SID_PRINTSIZE, TRUE, &pItem) == SFX_ITEM_SET) { nU16 = ((const SfxUInt16Item *) pItem)->GetValue(); - if (ePrintSize != nU16) - { ePrintSize = (SmPrintSize) nU16; - bModified = TRUE; - } + SetPrintSize( (SmPrintSize) nU16 ); } if (rSet.GetItemState(SID_PRINTZOOM, TRUE, &pItem) == SFX_ITEM_SET) { nU16 = ((const SfxUInt16Item *) pItem)->GetValue(); - if (nPrintZoom != nU16) - { nPrintZoom = (USHORT) nU16; - bModified = TRUE; - } + SetPrintZoomFactor( nU16 ); } - - BOOL bVal; if (rSet.GetItemState(SID_PRINTTITLE, TRUE, &pItem) == SFX_ITEM_SET) { bVal = ((const SfxBoolItem *) pItem)->GetValue(); - if (bPrintTitle != bVal) - { bPrintTitle = bVal; - bModified = TRUE; - } + SetPrintTitle( bVal ); } if (rSet.GetItemState(SID_PRINTTEXT, TRUE, &pItem) == SFX_ITEM_SET) { bVal = ((const SfxBoolItem *) pItem)->GetValue(); - if (bPrintText != bVal) - { bPrintText = bVal; - bModified = TRUE; - } + SetPrintFormulaText( bVal ); } if (rSet.GetItemState(SID_PRINTFRAME, TRUE, &pItem) == SFX_ITEM_SET) { bVal = ((const SfxBoolItem *) pItem)->GetValue(); - if (bPrintFrame != bVal) - { bPrintFrame = bVal; - bModified = TRUE; - } + SetPrintFrame( bVal ); } if (rSet.GetItemState(SID_AUTOREDRAW, TRUE, &pItem) == SFX_ITEM_SET) { bVal = ((const SfxBoolItem *) pItem)->GetValue(); - if (bAutoRedraw != bVal) - { bAutoRedraw = bVal; - bModified = TRUE; - } + SetAutoRedraw( bVal ); } if (rSet.GetItemState(SID_NO_RIGHT_SPACES, TRUE, &pItem) == SFX_ITEM_SET) { bVal = ((const SfxBoolItem *) pItem)->GetValue(); - if (bNoRightSpaces != bVal) - { bNoRightSpaces = bVal; - bModified = TRUE; + if (IsIgnoreSpacesRight() != bVal) + { + SetIgnoreSpacesRight( bVal ); // (angezeigte) Formeln müssen entsprechen neu formatiert werden. // Das erreichen wir mit: Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); } } - - if (bModified) - ConfigChangedAction(); } @@ -300,85 +166,19 @@ void SmConfig::ConfigToItemSet(SfxItemSet &rSet) const { const SfxItemPool *pPool = rSet.GetPool(); - rSet.Put(SfxStringItem(pPool->GetWhich(SID_SYMBOLFILE), - aSymbolFile)); - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTSIZE), - (UINT16) ePrintSize)); + (UINT16) GetPrintSize())); rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTZOOM), - (UINT16) nPrintZoom)); + (UINT16) GetPrintZoomFactor())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), bPrintTitle)); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT), bPrintText)); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), bPrintFrame)); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), bAutoRedraw)); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), bNoRightSpaces)); + rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), IsPrintTitle())); + rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT), IsPrintFormulaText())); + rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), IsPrintFrame())); + rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), IsAutoRedraw())); + rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), IsIgnoreSpacesRight())); } -/**************************************************************************/ - - -SvStream & operator << (SvStream &rStream, const SmConfig &rConfig) -{ - rStream << CONFIGVERSION; - - UINT16 nFlags = rConfig.bPrintTitle - | (rConfig.bPrintText << 1) - | (rConfig.bPrintFrame << 2) - | (rConfig.bWarnNoSymbols << 3) - | (rConfig.bToolBoxVisible << 4) - | (rConfig.bCmdBoxWindow << 5) - | (rConfig.bAutoRedraw << 6) - | (rConfig.bFormulaCursor << 7) - | (rConfig.bNoRightSpaces << 8); - - rStream << nFlags; - - rStream << (INT16) rConfig.ePrintSize; - rStream << (INT16) rConfig.nPrintZoom; - - rStream.WriteByteString(rConfig.aSymbolFile, gsl_getSystemTextEncoding()); - rStream << rConfig.aStandardFormat; - - for (int i = 0; i < 7; i++) - rStream << rConfig.vFontPickList[i]; - - return rStream; -} - - -SvStream & operator >> (SvStream &rStream, SmConfig &rConfig) -{ - INT16 nVer; - rStream >> nVer; - - UINT16 nFlags; - rStream >> nFlags; - - rConfig.bPrintTitle = nFlags & 0x01; - rConfig.bPrintText = (nFlags >> 1) & 0x01; - rConfig.bPrintFrame = (nFlags >> 2) & 0x01; - rConfig.bWarnNoSymbols = (nFlags >> 3) & 0x01; - rConfig.bToolBoxVisible = (nFlags >> 4) & 0x01; - rConfig.bCmdBoxWindow = (nFlags >> 5) & 0x01; - rConfig.bAutoRedraw = (nFlags >> 6) & 0x01; - rConfig.bFormulaCursor = (nFlags >> 7) & 0x01; - rConfig.bNoRightSpaces = (nFlags >> 8) & 0x01; - - INT16 nI16; - rStream >> nI16; - rConfig.ePrintSize = (SmPrintSize) nI16; - rStream >> nI16; - rConfig.nPrintZoom = (USHORT) nI16; - - rStream.ReadByteString(rConfig.aSymbolFile, gsl_getSystemTextEncoding()); - rStream >> rConfig.aStandardFormat; - - for (int i = 0; i < 7; i++) - rStream >> rConfig.vFontPickList[i]; - - return rStream; -} +///////////////////////////////////////////////////////////////// diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index dc37f00b82c7..d5faf29af94a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tl $ $Date: 2001-02-07 12:46:52 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -294,75 +294,6 @@ SfxTabPage* SmPrintOptionsTabPage::Create(Window* pWindow, const SfxItemSet& rSe /**************************************************************************/ -#ifdef NEVER -SmExtraOptionsTabPage::SmExtraOptionsTabPage(const SfxItemSet& rInSet, Window * pParent, BOOL bFreeRes) - : SfxTabPage(pParent, SmResId(RID_EXTRAOPTIONPAGE), rInSet), - aAutoRedraw (this, ResId(1)), - aFixedText1 (this, ResId(1)), - aSymbolFile (this, ResId(2), 32), - aBrowseButton (this, ResId(1)) -{ - if (bFreeRes) - FreeResource(); - - aBrowseButton.SetClickHdl(LINK(this, SmExtraOptionsTabPage, SymClickHdl)); -} - - -IMPL_LINK( SmExtraOptionsTabPage, SymClickHdl, PushButton *, pPushButton ) -{ - SfxSimpleFileDialog *pFileDialog = - new SfxSimpleFileDialog(this, WinBits(WB_OPEN | WB_3DLOOK)); - -#ifdef MAC - pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), SmResId(RID_FILESYMTYP)); - pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), "****"); - - pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); -#else - pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), C2S("*.sms")); - pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), C2S("*.*")); - - pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); - - pFileDialog->SetDefaultExt(C2S("*.sms")); -#endif - - pFileDialog->SetPath(aSymbolFile.GetText()); - - if (pFileDialog->Execute() == RET_OK) - aSymbolFile.SetText(pFileDialog->GetPath()); - - delete pFileDialog; - return 0; -} - - -BOOL SmExtraOptionsTabPage::FillItemSet(SfxItemSet& rOutSet) -{ - rOutSet.Put(SfxBoolItem(GetWhich(SID_AUTOREDRAW), aAutoRedraw.IsChecked())); - rOutSet.Put(SfxStringItem(GetWhich(SID_SYMBOLFILE), aSymbolFile.GetText())); - - return (TRUE); -} - - -void SmExtraOptionsTabPage::Reset(const SfxItemSet& rOutSet) -{ - aAutoRedraw.Check(((const SfxBoolItem&)rOutSet.Get(GetWhich(SID_AUTOREDRAW))).GetValue()); - aSymbolFile.SetText(((const SfxStringItem&)rOutSet.Get(GetWhich(SID_SYMBOLFILE))).GetValue()); -} - - -SfxTabPage* SmExtraOptionsTabPage::Create(Window* pWindow, const SfxItemSet& rSet) -{ - return (new SmExtraOptionsTabPage(rSet, pWindow)); -} -#endif //NEVER - -/**************************************************************************/ - - void SmShowFont::Paint(const Rectangle&) { XubString Text (GetFont().GetName()); @@ -494,7 +425,9 @@ IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, pButton ) if (pQueryBox->Execute() == RET_YES) { SmModule *pp = SM_MOD1(); - WriteTo(pp->GetConfig()->GetFormat()); + SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); + WriteTo( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt ); } delete pQueryBox; @@ -598,7 +531,9 @@ IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButt if (pQueryBox->Execute() == RET_YES) { SmModule *pp = SM_MOD1(); - WriteTo(pp->GetConfig()->GetFormat()); + SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); + WriteTo( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt ); } delete pQueryBox; @@ -801,7 +736,9 @@ IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, pButton ) if (pQueryBox->Execute() == RET_YES) { SmModule *pp = SM_MOD1(); - WriteTo(pp->GetConfig()->GetFormat()); + SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); + WriteTo( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt ); } delete pQueryBox; return 0; @@ -1093,7 +1030,9 @@ IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, pButton ) if (pQueryBox->Execute() == RET_YES) { SmModule *pp = SM_MOD1(); - WriteTo(pp->GetConfig()->GetFormat()); + SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); + WriteTo( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt ); } delete pQueryBox; @@ -1390,7 +1329,7 @@ void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) if (bDeleteText) aSymbolSets.SetNoSelection(); - USHORT nNumSymSets = rSymSetMgr.GetCount(); + USHORT nNumSymSets = rSymSetMgr.GetSymbolSetCount(); for (USHORT i = 0; i < nNumSymSets; i++) aSymbolSets.InsertEntry(rSymSetMgr.GetSymbolSet(i)->GetName()); } @@ -1521,6 +1460,12 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre } +SmSymbolDialog::~SmSymbolDialog() +{ + rSymSetMgr.Save(); +} + + BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName) { BOOL bRet = FALSE; @@ -1764,7 +1709,7 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText) if (bDeleteText) rComboBox.SetText(XubString()); - USHORT nNumSymSets = aSymSetMgrCopy.GetCount(); + USHORT nNumSymSets = aSymSetMgrCopy.GetSymbolSetCount(); for (USHORT i = 0; i < nNumSymSets; i++) rComboBox.InsertEntry(aSymSetMgrCopy.GetSymbolSet(i)->GetName()); } @@ -1919,7 +1864,8 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) // Symbol ins SymbolSet einfügen SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(), - aCharsetDisplay.GetSelectChar()); + aCharsetDisplay.GetSelectChar(), + aSymbolSets.GetText()); pSymSet->AddSymbol(pSym); // update der Hash Tabelle erzwingen (damit aAddBtn disabled wird). @@ -2156,7 +2102,7 @@ short SmSymDefineDialog::Execute() // leere SymbolSets aus dem Ergebnis entfernen. // Dabei von hinten durch das array iterieren, da beim löschen die // Elemente aufrücken. - USHORT nSymbolSets = aSymSetMgrCopy.GetCount(); + USHORT nSymbolSets = aSymSetMgrCopy.GetSymbolSetCount(); for (int i = nSymbolSets - 1; i >= 0; i--) if (aSymSetMgrCopy.GetSymbolSet(i)->GetCount() == 0) aSymSetMgrCopy.DeleteSymbolSet(i); @@ -2410,12 +2356,3 @@ void SmSymDefineDialog::SelectChar(xub_Unicode cChar) /**************************************************************************/ -#ifdef NEVER -SfxTabPage* SmGeneralTabPage::Create(Window* pWindow, const SfxItemSet& rSet) -{ - return new SmGeneralTabPage(pWindow, rSet); -} -#endif NEVER - - - diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index cfee3c01eaea..a5e903c3c022 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -2,9 +2,9 @@ * * $RCSfile: document.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: tl $ $Date: 2001-04-19 14:47:39 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -273,19 +273,6 @@ void SmDocShell::SFX_NOTIFY(SfxBroadcaster&, const TypeId&, { switch (((SfxSimpleHint&)rHint).GetId()) { - case HINT_CONFIGCHANGED: - { - SmModule *pp = SM_MOD1(); - - if (pp->GetConfig()->IsAutoRedraw()) - { nModifyCount++; //! merkwrdig... - // ohne dies wird die Grafik letztlich - // nicht geupdatet - Resize(); - } - break; - } - case HINT_FORMATCHANGED: SetFormulaArranged(FALSE); nModifyCount++; //! merkwrdig... @@ -298,14 +285,7 @@ void SmDocShell::SFX_NOTIFY(SfxBroadcaster&, const TypeId&, void SmDocShell::LoadSymbols() { - SmModule *pp = SM_MOD1(); - String sURL( pp->GetConfig()->GetSymbolFile() ); - - SvtPathOptions aOpt; - sURL = aOpt.SubstituteVariable( sURL ); - if( !FStatHelper::IsDocument( sURL ) ) - aOpt.SearchFile( sURL, SvtPathOptions::PATH_USERCONFIG ); - GetSymSetManager().Load( sURL ); + GetSymSetManager().Load(); } @@ -643,7 +623,7 @@ SmDocShell::SmDocShell(SfxObjectCreateMode eMode) : SetPool(&SFX_APP()->GetPool()); SmModule *pp = SM_MOD1(); - aFormat = pp->GetConfig()->GetFormat(); + aFormat = pp->GetConfig()->GetStandardFormat(); StartListening(aFormat); StartListening(*pp->GetConfig()); @@ -665,8 +645,6 @@ SmDocShell::~SmDocShell() EndListening(aFormat); EndListening(*pp->GetConfig()); - SaveSymbols(); - delete pEditEngine; delete pEditEngineItemPool; delete pTree; @@ -894,7 +872,9 @@ void SmDocShell::ImplSave( SvStorageStreamRef xStrm ) << 'T'; xStrm->WriteByteString(exString); *xStrm << 'F' << aFormat - << 'S' << GetSymSetManager().GetAccessedSymbols() + << 'S'; + xStrm->WriteByteString( ExportString(C2S("unknown")) ); + *xStrm << (USHORT) 0 << '\0'; } @@ -1090,10 +1070,7 @@ BOOL SmDocShell::ImportSM20File(SvStream *pStream, BOOL bInsert) case 'S': pSymbolSet = new SmSymSet(); ReadSM20SymSet(pStream, pSymbolSet); - if (!bInsert) - GetSymSetManager().AppendExtraSymbolSet(pSymbolSet); - else - delete pSymbolSet; + delete pSymbolSet; break; default: @@ -1127,46 +1104,6 @@ void SmDocShell::Execute(SfxRequest& rReq) break; } - case SID_SYMBOLS_LOAD: - { - SmModule *pp = SM_MOD1(); - - SfxSimpleFileDialog *pFileDialog = - new SfxSimpleFileDialog(0, WinBits(WB_OPEN | WB_3DLOOK)); - -#ifdef MAC - pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), SmResId(RID_FILESYMTYP)); - pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), C2S("****")); - - pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); -#else - String aExt( C2S("*.sms" )); - pFileDialog->AddFilter(SmResId(RID_SYMBOLFILESSTR), aExt); - pFileDialog->AddFilter(SmResId(RID_ALLFILESSTR), C2S("*.*")); - pFileDialog->SetCurFilter(SmResId(RID_SYMBOLFILESSTR)); - pFileDialog->SetDefaultExt(aExt); -#endif - - pFileDialog->SetPath(pp->GetConfig()->GetSymbolFile()); - - if ( RET_OK == pFileDialog->Execute() ) - { - // save old symbols and sets if necessary - if (GetSymSetManager().IsModified()) - GetSymSetManager().Save(); - // load new symbols and sets from file - INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); - aURLObj.SetSmartURL( pFileDialog->GetPath() ); - GetSymSetManager().Load( aURLObj.GetMainURL() ); - // make that file the new default symbolfile - SM_MOD1()->GetConfig()->SetSymbolFile( pFileDialog->GetPath() ); - } - - delete pFileDialog; - } - break; - case SID_AUTO_REDRAW : { SmModule *pp = SM_MOD1(); @@ -1321,16 +1258,19 @@ void SmDocShell::Execute(SfxRequest& rReq) pAlignDialog->ReadFrom(GetFormat()); if (pAlignDialog->Execute() == RET_OK) { - SmFormat& rOldFormat = GetFormat(); + SmFormat aOldFormat(GetFormat()); pAlignDialog->WriteTo(GetFormat()); + SmModule *pp = SM_MOD1(); - pAlignDialog->WriteTo(pp->GetConfig()->GetFormat()); + SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); + pAlignDialog->WriteTo( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt ); SfxUndoManager *pUndoMgr = GetUndoManager(); if (pUndoMgr) pUndoMgr->AddUndoAction( - new SmFormatAction(this, rOldFormat, GetFormat())); + new SmFormatAction(this, aOldFormat, GetFormat())); if (aText.Len ()) { @@ -1594,7 +1534,6 @@ BOOL SmDocShell::Try3x (SvStorage *pStor, long lTime; ULONG lDate; String aBuffer; - SmSymSet *pSymbolSet; *pSvStream >> lIdent >> lVersion; @@ -1638,10 +1577,10 @@ BOOL SmDocShell::Try3x (SvStorage *pStor, case 'S': { - pSymbolSet = new SmSymSet(); - *pSvStream >> *pSymbolSet; - - GetSymSetManager().AppendExtraSymbolSet(pSymbolSet); + String aTmp; + USHORT n; + pSvStream->ReadByteString(aTmp, gsl_getSystemTextEncoding()); + *pSvStream >> n; break; } @@ -1738,8 +1677,7 @@ BOOL SmDocShell::Try2x (SvStorage *pStor, { pSymbolSet = new SmSymSet(); ReadSM20SymSet(pSvStream, pSymbolSet); - - GetSymSetManager().AppendExtraSymbolSet(pSymbolSet); + delete pSymbolSet; break; } diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index f79388822b41..2f86a4819141 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -2,9 +2,9 @@ * * $RCSfile: format.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2000-11-02 15:07:16 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -129,6 +129,13 @@ SmFormat::SmFormat() } +void SmFormat::SetFont(USHORT nIdent, const SmFace &rFont) +{ + vFont[nIdent] = rFont; + vFont[nIdent].SetTransparent( TRUE ); + vFont[nIdent].SetAlign( ALIGN_BASELINE ); +} + SmFormat & SmFormat::operator = (const SmFormat &rFormat) { SetBaseSize(rFormat.GetBaseSize()); @@ -149,6 +156,34 @@ SmFormat & SmFormat::operator = (const SmFormat &rFormat) } +BOOL SmFormat::operator == (const SmFormat &rFormat) const +{ + BOOL bRes = aBaseSize == rFormat.aBaseSize && + eHorAlign == rFormat.eHorAlign && + bIsTextmode == rFormat.bIsTextmode && + bScaleNormalBrackets == rFormat.bScaleNormalBrackets; + + USHORT i; + for (i = 0; i <= SIZ_END && bRes; ++i) + { + if (vSize[i] != rFormat.vSize[i]) + bRes = FALSE; + } + for (i = 0; i <= DIS_END && bRes; ++i) + { + if (vDist[i] != rFormat.vDist[i]) + bRes = FALSE; + } + for (i = 0; i <= FNT_END && bRes; ++i) + { + if (vFont[i] != rFormat.vFont[i]) + bRes = FALSE; + } + + return bRes; +} + + SvStream & operator << (SvStream &rStream, const SmFormat &rFormat) { //Da hier keinerlei Kompatibilit„t vorgesehen ist muessen wir leider diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk index 4ddd184983b5..fc78e3f879c3 100644 --- a/starmath/source/makefile.mk +++ b/starmath/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: as $ $Date: 2001-03-19 13:02:50 $ +# last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -91,14 +91,16 @@ SMDLL=TRUE SRS2NAME =smres SRC2FILES = smres.src \ + symbol.src \ commands.src SLOFILES = \ - $(SLO)$/register.obj \ - $(SLO)$/typemap.obj \ + $(SLO)$/register.obj \ + $(SLO)$/typemap.obj \ $(SLO)$/symbol.obj \ $(SLO)$/toolbox.obj \ $(SLO)$/action.obj \ + $(SLO)$/cfgitem.obj \ $(SLO)$/config.obj \ $(SLO)$/dialog.obj \ $(SLO)$/document.obj \ @@ -109,7 +111,7 @@ SLOFILES = \ $(SLO)$/parse.obj \ $(SLO)$/utility.obj \ $(SLO)$/smdll.obj \ - $(SLO)$/smmod.obj \ + $(SLO)$/smmod.obj \ $(SLO)$/view.obj \ $(SLO)$/edit.obj \ $(SLO)$/rect.obj \ @@ -117,7 +119,7 @@ SLOFILES = \ $(SLO)$/xchar.obj EXCEPTIONSFILES = \ - $(SLO)$/register.obj \ + $(SLO)$/register.obj \ $(SLO)$/mathml.obj \ $(SLO)$/unomodel.obj diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index 40794b2ceabd..4cfc76da1363 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2,9 +2,9 @@ * * $RCSfile: parse.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tl $ $Date: 2001-04-25 15:13:15 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -722,7 +722,10 @@ void SmParser::NextToken() CurToken.nRow = Row; CurToken.nCol = nTmpStart - ColOff + 1; - rnEndPos = aTmpRes.EndPos; + if (aTmpRes.EndPos > rnEndPos) + rnEndPos = aTmpRes.EndPos; + else + ++rnEndPos; } break; case '[': @@ -1314,7 +1317,7 @@ void SmParser::Blank() // Blanks am Zeilenende ignorieren wenn die entsprechende Option gesetzt ist if (CurToken.eType == TNEWLINE || CurToken.eType == TEND - && SM_MOD1()->GetConfig()->IsNoRightSpaces()) + && SM_MOD1()->GetConfig()->IsIgnoreSpacesRight()) pBlankNode->Clear(); NodeStack.Push(pBlankNode); diff --git a/starmath/source/smdll.cxx b/starmath/source/smdll.cxx index e1b1bbb97758..3b5c892ad7d0 100644 --- a/starmath/source/smdll.cxx +++ b/starmath/source/smdll.cxx @@ -2,9 +2,9 @@ * * $RCSfile: smdll.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2001-02-13 08:00:47 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,8 +147,6 @@ void SmDLL::Init() SmToolBoxWrapper::RegisterChildWindow(TRUE); SmCmdBoxWrapper::RegisterChildWindow(TRUE); - - ((SmModule*) *ppShlPtr)->InitManager (); } /************************************************************************* diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 7e1342e3294e..9f987208619f 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: smmod.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:26 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -124,25 +124,32 @@ SFX_IMPL_INTERFACE(SmModule, SfxModule, SmResId(RID_APPLICATION)) SFX_STATUSBAR_REGISTRATION(SmResId(RID_STATUSBAR)); } + SmModule::SmModule(SvFactory* pObjFact) : SmModuleDummy(SFX_APP()->CreateResManager("sm"), FALSE, pObjFact) { SetName( C2S("StarMath" )); - pConfig = new SmConfig; - pConfig->Initialize(); - - pSymSetManager = new SmSymSetManager; - pRectCache = new SmRectCache; + pConfig = 0; + pRectCache = new SmRectCache; } + SmModule::~SmModule() { delete pConfig; - delete pSymSetManager; delete pRectCache; } + +SmConfig * SmModule::GetConfig() +{ + if(!pConfig) + pConfig = new SmConfig; + return pConfig; +} + + void SmModule::GetState(SfxItemSet &rSet) { SfxWhichIter aIter(rSet); @@ -172,12 +179,6 @@ void SmModule::Free() { } -void SmModule::InitManager() -{ - pSymSetManager->Init(); -} - - SfxModule *SmModuleDummy::Load() { diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index df51ef5e2f05..7e596927759a 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: tl $ $Date: 2001-04-09 09:48:32 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,12 +61,18 @@ #pragma hdrstop +#ifndef _OSL_MUTEX_HXX_ +#include +#endif #ifndef _UCBHELPER_CONTENT_HXX #include #endif #ifndef _SV_MSGBOX_HXX //autogen #include #endif +#ifndef _SV_RESARY_HXX +#include +#endif #ifndef _SFXDISPATCH_HXX //autogen #include #endif @@ -79,6 +85,7 @@ #include "utility.hxx" #include "dialog.hxx" #include "config.hxx" +#include "cfgitem.hxx" #include "smmod.hxx" #include "starmath.hrc" @@ -104,6 +111,8 @@ using namespace ::rtl; #define SF_IDENT 0x30334D53L +SV_IMPL_PTRARR( SymbolArray, SmSym * ); + /**************************************************************************/ /* ** @@ -113,6 +122,74 @@ using namespace ::rtl; long SF_Ident = SF_IDENT; +/**************************************************************************/ + +class SmMathConfigResource : public Resource +{ + ResStringArray aUiSymbolNamesAry; + ResStringArray aExportSymbolNamesAry; + +public: + SmMathConfigResource(); + + ResStringArray& GetUiSymbolNamesArray() { return aUiSymbolNamesAry; } + ResStringArray& GetExportSymbolNamesArray() { return aExportSymbolNamesAry; } +}; + + +SmMathConfigResource::SmMathConfigResource() : + Resource( SmResId(RID_LOCALIZED_SYMBOL_NAMES) ), + aUiSymbolNamesAry ( ResId(RID_UI_SYMBOL_NAMES) ), + aExportSymbolNamesAry ( ResId(RID_EXPORT_SYMBOL_NAMES) ) +{ + FreeResource(); +} + +/**************************************************************************/ + +String GetExportSymbolName( const String &rUiSymbolName ) +{ + String aRes; + + SmMathConfigResource aCfgRes; + ResStringArray &rUiNames = aCfgRes.GetUiSymbolNamesArray(); + ResStringArray &rExportNames = aCfgRes.GetExportSymbolNamesArray(); + USHORT nCount = rUiNames.Count(); + + for (USHORT i = 0; i < nCount; ++i) + { + if (rUiSymbolName == rUiNames.GetString(i)) + { + aRes = rExportNames.GetString(i); + break; + } + } + + return aRes; +} + + +String GetUiSymbolName( const String &rExportSymbolName ) +{ + String aRes; + + SmMathConfigResource aCfgRes; + ResStringArray &rUiNames = aCfgRes.GetUiSymbolNamesArray(); + ResStringArray &rExportNames = aCfgRes.GetExportSymbolNamesArray(); + USHORT nCount = rExportNames.Count(); + + for (USHORT i = 0; i < nCount; ++i) + { + if (rExportSymbolName == rExportNames.GetString(i)) + { + aRes = rUiNames.GetString(i); + break; + } + } + + return aRes; +} + /**************************************************************************/ /* @@ -125,26 +202,40 @@ SmSym::SmSym() : Name(C2S("unknown")), Character('\0'), pHashNext(0), - pSymSetManager(0) + pSymSetManager(0), + bPredefined(FALSE), + bDocSymbol(FALSE), + aSetName(C2S("unknown")) { + aExportName = Name; Face.SetTransparent(TRUE); } + SmSym::SmSym(const SmSym& rSymbol) { - Name = rSymbol.Name; - Face = rSymbol.Face; - Character = rSymbol.Character; + Name = rSymbol.Name; + Face = rSymbol.Face; + Character = rSymbol.Character; + aSetName = rSymbol.aSetName; + bPredefined = rSymbol.bPredefined; + bDocSymbol = rSymbol.bDocSymbol; + aExportName = rSymbol.aExportName; pHashNext = 0; pSymSetManager = 0; } -SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar) + +SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar, + const String& rSet, BOOL bIsPredefined) { - Name = rName; - Face = rFont; - Character = aChar; + Name = aExportName = rName; + Face = rFont; + Character = aChar; + aSetName = rSet; + bPredefined = bIsPredefined; + bDocSymbol = FALSE; pHashNext = 0; pSymSetManager = 0; @@ -153,9 +244,13 @@ SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar) SmSym& SmSym::operator = (const SmSym& rSymbol) { - Name = rSymbol.Name; - Face = rSymbol.Face; - Character = rSymbol.Character; + Name = rSymbol.Name; + Face = rSymbol.Face; + Character = rSymbol.Character; + aSetName = rSymbol.aSetName; + bPredefined = rSymbol.bPredefined; + bDocSymbol = rSymbol.bDocSymbol; + aExportName = rSymbol.aExportName; pHashNext = 0; @@ -360,40 +455,40 @@ SvStream& operator >> (SvStream& rStream, SmSymSet& rSymbolSet) /**************************************************************************/ + +static osl::Mutex & lcl_GetSymSetMgrMutex() +{ + static osl::Mutex aMutex; + return aMutex; +} + + void SmSymSetManager::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType) { - if (((SfxSimpleHint&)rHint).GetId() == HINT_CONFIGCHANGED) - { - SmViewShell *pViewSh = SmGetActiveView(); - if (pViewSh) - { - SfxDispatcher &rDis = *pViewSh->GetViewFrame()->GetDispatcher(); - rDis.Execute(SID_SAVESYMBOLS); - rDis.Execute(SID_LOADSYMBOLS); - } - } } + UINT32 SmSymSetManager::GetHashIndex(const String& rSymbolName) { UINT32 x = 0; for (xub_StrLen i = 0; i < rSymbolName.Len(); i++) x += x * rSymbolName.GetChar(i); - return x % NoHashEntries; + return x % pImpl->NoHashEntries; } + void SmSymSetManager::EnterHashTable(SmSymSet& rSymbolSet) { for (int i = 0; i < rSymbolSet.GetCount(); i++) { int j = GetHashIndex(rSymbolSet.GetSymbol(i).GetName()); - if (HashEntries[j] == 0) - HashEntries[j] = rSymbolSet.SymbolList.GetObject(i); + if (pImpl->HashEntries[j] == 0) + pImpl->HashEntries[j] = rSymbolSet.SymbolList.GetObject(i); else { - SmSym *p = HashEntries[j]; + SmSym *p = pImpl->HashEntries[j]; while (p->pHashNext) p = p->pHashNext; p->pHashNext = rSymbolSet.SymbolList.GetObject(i); @@ -404,12 +499,12 @@ void SmSymSetManager::EnterHashTable(SmSymSet& rSymbolSet) void SmSymSetManager::FillHashTable() { - if (HashEntries) + if (pImpl->HashEntries) { - memset(HashEntries, 0, NoHashEntries * sizeof(SmSym *)); + memset( pImpl->HashEntries, 0, pImpl->NoHashEntries * sizeof(SmSym *) ); - for (int i = 0; i < NoSymbolSets; i++) - EnterHashTable(*GetSymbolSet(i)); + for (UINT32 i = 0; i < pImpl->NoSymbolSets; i++) + EnterHashTable( *GetSymbolSet( (USHORT) i ) ); } } @@ -419,67 +514,53 @@ void SmSymSetManager::Init() StartListening(*pp->GetConfig()); } + void SmSymSetManager::Exit() { SmModule *pp = SM_MOD1(); EndListening(*pp->GetConfig()); } -SmSymSetManager::SmSymSetManager(UINT32 HashTableSize) + +SmSymSetManager::SmSymSetManager(USHORT HashTableSize) { - SymbolSets.Clear(); - NoSymbolSets = 0; - NoHashEntries = HashTableSize; - HashEntries = new SmSym *[NoHashEntries]; - memset(HashEntries, 0, sizeof(SmSym *) * NoHashEntries); - Modified = FALSE; + pImpl = new SmSymSetManager_Impl; + pImpl->SymbolSets.Clear(); + pImpl->NoSymbolSets = 0; + pImpl->NoHashEntries = HashTableSize; + pImpl->HashEntries = new SmSym *[pImpl->NoHashEntries]; + memset( pImpl->HashEntries, 0, sizeof(SmSym *) * pImpl->NoHashEntries ); + pImpl->Modified = FALSE; } SmSymSetManager::SmSymSetManager(const SmSymSetManager& rSymbolSetManager) { - SymbolSets.Clear(); - NoSymbolSets = 0; - NoHashEntries = rSymbolSetManager.NoHashEntries; - HashEntries = new SmSym *[NoHashEntries]; - memset(HashEntries, 0, sizeof(SmSym *) * NoHashEntries); - - for (int i = 0; i < rSymbolSetManager.GetCount(); i++) - AddSymbolSet(new SmSymSet(*rSymbolSetManager.GetSymbolSet(i))); - - Modified = rSymbolSetManager.Modified; } SmSymSetManager::~SmSymSetManager() { - for (int i = 0; i< NoSymbolSets; i++) - delete SymbolSets.Get(i); + USHORT i; + for (i = 0; i< pImpl->NoSymbolSets; i++) + delete pImpl->SymbolSets.Get(i); + delete pImpl->HashEntries; - delete HashEntries; + delete pImpl; + pImpl = 0; } + SmSymSetManager& SmSymSetManager::operator = (const SmSymSetManager& rSymbolSetManager) { - int i; - for (i = 0; i< NoSymbolSets; i++) - delete SymbolSets.Get(i); - - SymbolSets.Clear(); - NoSymbolSets = 0; - - for (i = 0; i < rSymbolSetManager.GetCount(); i++) - AddSymbolSet(new SmSymSet(*rSymbolSetManager.GetSymbolSet(i))); - - Modified = rSymbolSetManager.Modified; - return *this; } + USHORT SmSymSetManager::AddSymbolSet(SmSymSet* pSymbolSet) { - if (NoSymbolSets >= SymbolSets.GetSize()) - SymbolSets.SetSize(NoSymbolSets + 1); + if (pImpl->NoSymbolSets >= pImpl->SymbolSets.GetSize()) + pImpl->SymbolSets.SetSize(pImpl->NoSymbolSets + 1); - SymbolSets.Put(NoSymbolSets++, pSymbolSet); + pImpl->SymbolSets.Put(pImpl->NoSymbolSets++, pSymbolSet); pSymbolSet->pSymSetManager = this; @@ -487,9 +568,9 @@ USHORT SmSymSetManager::AddSymbolSet(SmSymSet* pSymbolSet) pSymbolSet->SymbolList.GetObject(i)->pSymSetManager = this; FillHashTable(); - Modified = TRUE; + pImpl->Modified = TRUE; - return NoSymbolSets - 1; + return (USHORT) (pImpl->NoSymbolSets - 1); } void SmSymSetManager::ChangeSymbolSet(SmSymSet* pSymbolSet) @@ -497,156 +578,182 @@ void SmSymSetManager::ChangeSymbolSet(SmSymSet* pSymbolSet) if (pSymbolSet) { FillHashTable(); - Modified = TRUE; + pImpl->Modified = TRUE; } } void SmSymSetManager::DeleteSymbolSet(USHORT SymbolSetNo) { - delete SymbolSets.Get(SymbolSetNo); - NoSymbolSets--; + delete pImpl->SymbolSets.Get(SymbolSetNo); + pImpl->NoSymbolSets--; - for (int i = SymbolSetNo; i < NoSymbolSets; i++) - SymbolSets.Put(i, SymbolSets.Get(i + 1)); + for (UINT32 i = SymbolSetNo; i < pImpl->NoSymbolSets; i++) + pImpl->SymbolSets.Put(i, pImpl->SymbolSets.Get(i + 1)); FillHashTable(); - Modified = TRUE; + pImpl->Modified = TRUE; } USHORT SmSymSetManager::GetSymbolSetPos(const String& rSymbolSetName) const { - for (USHORT i = 0; i < NoSymbolSets; i++) - if (SymbolSets.Get(i)->GetName() == rSymbolSetName) + for (USHORT i = 0; i < pImpl->NoSymbolSets; i++) + if (pImpl->SymbolSets.Get(i)->GetName() == rSymbolSetName) return (i); return SYMBOLSET_NONE; } - SmSym *SmSymSetManager::GetSymbol(const String& rSymbolName) { - SmSym *p = HashEntries[GetHashIndex(rSymbolName)]; - while (p) + SmSym *pSym = pImpl->HashEntries[GetHashIndex(rSymbolName)]; + while (pSym) { - if (p->Name == rSymbolName) + if (pSym->Name == rSymbolName) break; - p = p->pHashNext; + pSym = pSym->pHashNext; } - return p; + + return pSym; } -void SmSymSetManager::Load( const String &rURL ) + +void SmSymSetManager::AddReplaceSymbol( const SmSym &rSymbol ) { - if( aStreamName != rURL ) + SmSym *pSym = GetSymbol( rSymbol.GetName() ); + if (pSym) { - for (int i = 0; i< NoSymbolSets; i++) - delete SymbolSets.Get(i); + *pSym = rSymbol; + } + else + { + USHORT nPos = GetSymbolSetPos( rSymbol.GetSetName() ); + if (SYMBOLSET_NONE == nPos) + { + AddSymbolSet( new SmSymSet( rSymbol.GetSetName() ) ); + nPos = GetSymbolSetPos( rSymbol.GetSetName() ); + } + DBG_ASSERT( nPos != SYMBOLSET_NONE, "SymbolSet not found"); + GetSymbolSet( nPos )->AddSymbol( new SmSym( rSymbol ) ); + } + SetModified( TRUE ); +} - SymbolSets.Clear(); - NoSymbolSets = 0; - aStreamName = rURL; +USHORT SmSymSetManager::GetSymbolCount() const +{ + USHORT nRes = 0; + USHORT nSets = GetSymbolSetCount(); + for (USHORT i = 0; i < nSets; ++i) + nRes += GetSymbolSet(i)->GetCount(); + return nRes; +} - // get stream to use - SfxMedium aMedium( aStreamName, - STREAM_READ | STREAM_SHARE_DENYWRITE, FALSE ); - aMedium.SetTransferPriority( SFX_TFPRIO_SYNCHRON ); - SvStream *pStream = aMedium.GetInStream(); - if( pStream && !pStream->GetError() ) - { - *pStream >> *this; - Modified = FALSE; - } - else - { - SmModule *pp = SM_MOD1(); +const SmSym * SmSymSetManager::GetSymbol( USHORT nPos ) const +{ + const SmSym *pRes = 0; - if ( pp->GetConfig()->IsWarnNoSymbols() ) - { - ErrorBox aErrorBox( NULL, SmResId( RID_READSYMBOLERROR ) ); - String aString( aErrorBox.GetMessText() ); - aString.SearchAndReplaceAscii( "%FILE%", aStreamName ); - aErrorBox.SetMessText( aString ); - aErrorBox.Execute(); - - Modified = FALSE; - pp->GetConfig()->SetWarnNoSymbols(FALSE); - } - } + INT16 nIdx = 0; + USHORT nSets = GetSymbolSetCount(); + USHORT i = 0; + while (i < nSets && !pRes) + { + USHORT nEntries = GetSymbolSet(i)->GetCount(); + if (nPos < nIdx + nEntries) + pRes = &GetSymbolSet(i)->GetSymbol( nPos - nIdx ); + else + nIdx += nEntries; + ++i; } + + return pRes; } -void SmSymSetManager::Save() + +void SmSymSetManager::Load() { - if (Modified) - { - SfxMedium aMedium( aStreamName, - STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYALL, FALSE ); - SvStream *pStream = aMedium.GetOutStream(); + SmMathConfig &rCfg = *SM_MOD1()->GetConfig(); - if( pStream && !pStream->GetError() ) + USHORT nCount = rCfg.GetSymbolCount(); + USHORT i; + for (i = 0; i < nCount; ++i) + { + const SmSym *pSym = rCfg.GetSymbol(i); + if (pSym) { - *pStream << *this; - Modified = FALSE; + const String &rSetName = pSym->GetSetName(); + if (SYMBOLSET_NONE == GetSymbolSetPos( rSetName )) + AddSymbolSet( new SmSymSet( rSetName ) ); + USHORT nSetPos = GetSymbolSetPos( rSetName ); + SmSymSet *pSymSet = GetSymbolSet( nSetPos ); + if (pSymSet) + { + pSymSet->AddSymbol( new SmSym( *pSym ) ); + } } - else - { - ErrorBox aErrorBox( NULL, SmResId(RID_WRITESYMBOLERROR)); - String aString (aErrorBox.GetMessText()); - USHORT nPos = aString.SearchAscii("%FILE%"); + } + // build HashTables + nCount = GetSymbolSetCount(); + for (i = 0; i < nCount; ++i) + ChangeSymbolSet( GetSymbolSet( i ) ); - aString.Erase(nPos, 6); - aString.Insert(aStreamName, nPos); - aErrorBox.SetMessText(aString); + + if (0 == nCount) + { + SmModule *pp = SM_MOD1(); + if ( pp->GetConfig()->IsNoSymbolsWarning() ) + { + ErrorBox aErrorBox( NULL, SmResId( RID_READSYMBOLERROR ) ); + String aString( aErrorBox.GetMessText() ); + aString.SearchAndReplaceAscii( "%FILE%", pImpl->aStreamName ); + aErrorBox.SetMessText( aString ); aErrorBox.Execute(); + + pImpl->Modified = FALSE; + pp->GetConfig()->SetNoSymbolsWarning(FALSE); } - aMedium.Commit(); } } - -SvStream& operator << (SvStream& rStream, SmSymSetManager& rSymbolSetManager) +void SmSymSetManager::Save() { - rStream << (long)SF_IDENT << (USHORT) rSymbolSetManager.NoSymbolSets; + SmMathConfig &rCfg = *SM_MOD1()->GetConfig(); - for (int i = 0; i < rSymbolSetManager.NoSymbolSets; i++) - rStream << *rSymbolSetManager.GetSymbolSet(i); + // get number of Symbols + USHORT nSymbolCount = 0; + USHORT nSetCount = GetSymbolSetCount(); + USHORT i; + for (i = 0; i < nSetCount; ++i) + nSymbolCount += GetSymbolSet( i )->GetCount(); - return rStream; -} - -SvStream& operator >> (SvStream& rStream, SmSymSetManager& rSymbolSetManager) -{ - rStream >> SF_Ident; - if (SF_Ident == SF_IDENT || SF_Ident == SF_SM20IDENT) + if (nSymbolCount) { - USHORT n; - rStream >> n; - - if (rSymbolSetManager.HashEntries) - memset(rSymbolSetManager.HashEntries, 0, - rSymbolSetManager.NoHashEntries * sizeof(SmSym *)); - - for (int i = 0; i < n; i++) + USHORT nSaveSymbolCnt = 0; + const SmSym **pSymbols = new const SmSym* [ nSymbolCount ]; + const SmSym **pSym = pSymbols; + for (i = 0; i < nSetCount; ++i) { - SmSymSet *pSymbolSet; - - if ((pSymbolSet = new SmSymSet) == 0) - break; - - rStream >> *pSymbolSet; - rSymbolSetManager.AddSymbolSet(pSymbolSet); + const SmSymSet *pSymSet = GetSymbolSet( i ); + USHORT n = pSymSet->GetCount(); + for (USHORT j = 0; j < n; ++j) + { + const SmSym &rSym = pSymSet->GetSymbol( j ); + if (!rSym.IsDocSymbol()) + { + *pSym++ = &rSym; + ++nSaveSymbolCnt; + } + } } + DBG_ASSERT(pSym - pSymbols == nSaveSymbolCnt, "wrong number of symbols" ); + rCfg.ReplaceSymbols( pSymbols, nSaveSymbolCnt ); + delete pSymbols; } - - SF_Ident = SF_IDENT; - - return rStream; } + void ReadSM20SymSet(SvStream *pStream, SmSymSet *pSymbolSet) { SF_Ident = SF_SM20IDENT; diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx index b215e8bd4717..20c405f0a442 100644 --- a/starmath/source/toolbox.cxx +++ b/starmath/source/toolbox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: toolbox.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:27 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -251,7 +251,7 @@ IMPL_LINK_INLINE_END( SmToolBoxWindow, CmdSelectHdl, ToolBox*, pToolBox) void SmToolBoxWindow::ShowWindows() { - if ( SM_MOD1()->GetConfig()->IsToolBoxVisible() ) + if ( SM_MOD1()->GetConfig()->IsToolboxVisible() ) Show(); } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index b1afe771cf5c..0edcdb9d1ce0 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2,9 +2,9 @@ * * $RCSfile: view.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2001-03-08 09:27:43 $ + * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1055,7 +1055,7 @@ USHORT SmViewShell::Print(SfxProgress &rProgress, PrintDialog *pPrintDialog) } // output text on bottom - if (pp->GetConfig()->IsPrintText()) + if (pp->GetConfig()->IsPrintFormulaText()) { // Font aFont(FAMILY_DONTKNOW, Size(0, 600)); Font aFont; @@ -1116,7 +1116,7 @@ USHORT SmViewShell::Print(SfxProgress &rProgress, PrintDialog *pPrintDialog) case PRINT_SIZE_ZOOMED: { SmModule *pp = SM_MOD1(); - Fraction aFraction (pp->GetConfig()->GetPrintZoom(), 100); + Fraction aFraction (pp->GetConfig()->GetPrintZoomFactor(), 100); OutputMapMode = MapMode(MAP_100TH_MM, aZeroPoint, aFraction, aFraction); break; -- cgit v1.2.3 From 82b7f83ca0465fca9436e4c0b8d813827dcd7460 Mon Sep 17 00:00:00 2001 From: Martin Gallwey Date: Wed, 16 May 2001 10:54:28 +0000 Subject: #87071# moved usage of aChar _after_ declaration of aChar :) --- starmath/source/dialog.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index d5faf29af94a..b5e38e52f476 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ + * last change: $Author: mtg $ $Date: 2001-05-16 11:54:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1538,9 +1538,9 @@ void SmShowCharset::Paint(const Rectangle&) int x = (i % nColumns) * nLen; int y = (i / nColumns) * nLen; + XubString aChar((xub_Unicode) i); Size aTextSize(GetTextWidth(aChar), GetTextHeight()); - XubString aChar((xub_Unicode) i); DrawText(Point(x + (nLen - aTextSize.Width()) / 2, y + (nLen - aTextSize.Height()) / 2), aChar); } -- cgit v1.2.3 From f0385902984833eed53f2ad95d705006fa406eaa Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Fri, 15 Jun 2001 05:42:09 +0000 Subject: Fix #86988#: Redesign of dialogs --- starmath/inc/dialog.hxx | 29 ++++++++++++----------------- starmath/source/dialog.cxx | 34 ++++++++++++++++++---------------- starmath/source/dialog.hrc | 10 +++++----- 3 files changed, 35 insertions(+), 38 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index d8458e5a156e..f1f8224a9a7a 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ + * last change: $Author: fme $ $Date: 2001-06-15 06:41:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,9 +76,6 @@ #ifndef _SFXTABDLG_HXX //autogen #include #endif -#ifndef _SV_GROUP_HXX //autogen -#include -#endif #ifndef _SV_COMBOBOX_HXX //autogen #include #endif @@ -150,16 +147,16 @@ public: class SmPrintOptionsTabPage : public SfxTabPage { - FixedLine aGroupBox1; + FixedLine aFixedLine1; CheckBox aTitle; CheckBox aText; CheckBox aFrame; - FixedLine aGroupBox2; + FixedLine aFixedLine2; RadioButton aSizeNormal; RadioButton aSizeScaled; RadioButton aSizeZoomed; MetricField aZoom; - FixedLine aGroupBox3; + FixedLine aFixedLine3; CheckBox aNoRightSpaces; DECL_LINK(SizeButtonClickHdl, Button *); @@ -197,8 +194,7 @@ class SmFontDialog : public ModalDialog OKButton aOKButton1; CancelButton aCancelButton1; SmShowFont aShowFont; - GroupBox aGroupBox1; - GroupBox aGroupBox2; + FixedText aFixedText2; Font Face; @@ -229,7 +225,7 @@ class SmFontSizeDialog : public ModalDialog MetricField aOperatorSize; FixedText aFixedText8; MetricField aBorderSize; - GroupBox aGroupBox1; + FixedLine aFixedLine1; OKButton aOKButton1; CancelButton aCancelButton1; PushButton aDefaultButton; @@ -261,8 +257,8 @@ class SmFontTypeDialog : public ModalDialog SmFontPickListBox aSansFont; FixedText aFixedText7; SmFontPickListBox aFixedFont; - GroupBox aGroupBox1; - GroupBox aGroupBox2; + FixedLine aFixedLine1; + FixedLine aFixedLine2; OKButton aOKButton1; CancelButton aCancelButton1; MenuButton aMenuButton; @@ -321,7 +317,7 @@ class SmDistanceDialog : public ModalDialog MenuButton aMenuButton; PushButton aDefaultButton; FixedBitmap aBitmap; - GroupBox aGroupBox; + FixedLine aFixedLine; SmCategoryDesc *Categories[NOCATEGORIES]; USHORT nActiveCategory; @@ -352,7 +348,7 @@ class SmAlignDialog : public ModalDialog RadioButton aLeft; RadioButton aCenter; RadioButton aRight; - GroupBox aGroupBox1; + FixedLine aFixedLine1; OKButton aOKButton1; CancelButton aCancelButton1; PushButton aDefaultButton; @@ -423,12 +419,11 @@ class SmSymbolDialog : public ModalDialog FixedText aSymbolSetText; ListBox aSymbolSets; SmShowSymbolSet aSymbolSetDisplay; - GroupBox aGrpBox; FixedText aSymbolName; SmShowSymbol aSymbolDisplay; + PushButton aGetBtn; PushButton aCloseBtn; PushButton aEditBtn; - PushButton aGetBtn; SmSymSetManager &rSymSetMgr; const SmSymSet *pSymSet; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b5e38e52f476..ab2291fd145b 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mtg $ $Date: 2001-05-16 11:54:28 $ + * last change: $Author: fme $ $Date: 2001-06-15 06:42:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -224,16 +224,16 @@ IMPL_LINK_INLINE_END( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButt SmPrintOptionsTabPage::SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions) : SfxTabPage(pParent, SmResId(RID_PRINTOPTIONPAGE), rOptions), - aGroupBox1 (this, ResId( GB_PRINTOPTIONS )), + aFixedLine1 (this, ResId( FL_PRINTOPTIONS )), aTitle (this, ResId( CB_TITLEROW )), aText (this, ResId( CB_EQUATION_TEXT )), aFrame (this, ResId( CB_FRAME )), - aGroupBox2 (this, ResId( GB_PRINT_FORMAT )), + aFixedLine2 (this, ResId( FL_PRINT_FORMAT )), aSizeNormal (this, ResId( RB_ORIGINAL_SIZE )), aSizeScaled (this, ResId( RB_FIT_TO_PAGE )), aSizeZoomed (this, ResId( RB_ZOOM )), aZoom (this, ResId( MF_ZOOM )), - aGroupBox3 (this, ResId( GB_MISC_OPTIONS )), + aFixedLine3 (this, ResId( FL_MISC_OPTIONS )), aNoRightSpaces (this, ResId( CB_IGNORE_SPACING )) { FreeResource(); @@ -374,8 +374,7 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) aOKButton1 (this, ResId(1)), aCancelButton1 (this, ResId(1)), aShowFont (this, ResId(1)), - aGroupBox1 (this, ResId(1)), - aGroupBox2 (this, ResId(2)) + aFixedText2 (this, ResId(2)) { if (bFreeRes) FreeResource(); @@ -404,8 +403,9 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) Face.SetCharSet(RTL_TEXTENCODING_DONTKNOW); Face.SetTransparent(TRUE); - aShowFont.SetFillColor( Color(COL_LIGHTGRAY) ); - + Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); + aShowFont.SetBackground( aWhiteWall ); + aShowFont.SetBorderStyle( WINDOW_BORDER_MONO ); //Application::LeaveWait(); } @@ -449,7 +449,7 @@ SmFontSizeDialog::SmFontSizeDialog(Window * pParent, BOOL bFreeRes) aOperatorSize(this, ResId(7)), aFixedText8(this, ResId(8)), aBorderSize(this, ResId(8)), - aGroupBox1(this, ResId(1)), + aFixedLine1(this, ResId(1)), aOKButton1(this, ResId(1)), aCancelButton1(this, ResId(1)), aDefaultButton(this, ResId(1)) @@ -558,8 +558,8 @@ SmFontTypeDialog::SmFontTypeDialog(Window * pParent, BOOL bFreeRes) aSansFont (this, ResId(6)), aFixedText7 (this, ResId(7)), aFixedFont (this, ResId(7)), - aGroupBox1 (this, ResId(1)), - aGroupBox2 (this, ResId(2)), + aFixedLine1 (this, ResId(1)), + aFixedLine2 (this, ResId(2)), aOKButton1 (this, ResId(1)), aCancelButton1 (this, ResId(1)), aMenuButton (this, ResId(1)), @@ -892,7 +892,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) } aMenuButton.GetPopupMenu()->CheckItem(nCategory + 1, TRUE); - aGroupBox.SetText(Categories[nCategory]->GetName()); + aFixedLine.SetText(Categories[nCategory]->GetName()); nActiveCategory = nCategory; @@ -918,7 +918,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) aDefaultButton (this, ResId(1)), aCheckBox1 (this, ResId(1)), aBitmap (this, ResId(1)), - aGroupBox (this, ResId(1)) + aFixedLine (this, ResId(1)) { for (int i = 0; i < NOCATEGORIES; i++) Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); @@ -928,6 +928,8 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) if (bFreeRes) FreeResource(); + aBitmap.SetBorderStyle( WINDOW_BORDER_MONO ); + aMetricField1.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); aMetricField2.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); aMetricField3.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); @@ -1045,7 +1047,7 @@ SmAlignDialog::SmAlignDialog(Window * pParent, BOOL bFreeRes) aLeft (this, ResId(1)), aCenter (this, ResId(2)), aRight (this, ResId(3)), - aGroupBox1 (this, ResId(1)), + aFixedLine1 (this, ResId(1)), aOKButton1 (this, ResId(1)), aCancelButton1 (this, ResId(1)), aDefaultButton (this, ResId(1)) @@ -1429,7 +1431,6 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre aSymbolSetText (this, ResId(1)), aSymbolSets (this, ResId(1)), aSymbolSetDisplay (this, ResId(1)), - aGrpBox (this, ResId(1)), aSymbolName (this, ResId(2)), aSymbolDisplay (this, ResId(2)), aCloseBtn (this, ResId(3)), @@ -1448,6 +1449,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre // set background color to white Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); aSymbolDisplay .SetBackground( aWhiteWall ); + aSymbolDisplay .SetBorderStyle( WINDOW_BORDER_MONO ); aSymbolSetDisplay.SetBackground( aWhiteWall ); aSymbolSets .SetSelectHdl (LINK(this, SmSymbolDialog, SymbolSetChangeHdl)); diff --git a/starmath/source/dialog.hrc b/starmath/source/dialog.hrc index 8a4d781d981b..a27b0ba8771e 100644 --- a/starmath/source/dialog.hrc +++ b/starmath/source/dialog.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hrc,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tl $ $Date: 2001-02-07 12:44:52 $ + * last change: $Author: fme $ $Date: 2001-06-15 06:42:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,17 +59,17 @@ * ************************************************************************/ -#define GB_PRINTOPTIONS 10 +#define FL_PRINTOPTIONS 10 #define CB_TITLEROW 11 #define CB_EQUATION_TEXT 12 #define CB_FRAME 13 -#define GB_PRINT_FORMAT 20 +#define FL_PRINT_FORMAT 20 #define RB_ORIGINAL_SIZE 21 #define RB_FIT_TO_PAGE 22 #define RB_ZOOM 23 #define MF_ZOOM 24 -#define GB_MISC_OPTIONS 30 +#define FL_MISC_OPTIONS 30 #define CB_IGNORE_SPACING 31 -- cgit v1.2.3 From 84b08f028447333dece700faf84e9e8c2f18b60b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 22 Jun 2001 11:43:06 +0000 Subject: #87897# localization of symbol-set names --- starmath/inc/starmath.hrc | 6 ++-- starmath/inc/symbol.hxx | 23 ++++++------- starmath/source/cfgitem.cxx | 27 ++++++++++------ starmath/source/dialog.cxx | 12 +++---- starmath/source/symbol.cxx | 79 +++++++++++++++++++++++++++++++-------------- starmath/source/symbol.src | 14 ++++---- 6 files changed, 99 insertions(+), 62 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 4a80201e3575..f5da3e71d451 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -2,9 +2,9 @@ * * $RCSfile: starmath.hrc,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: tl $ $Date: 2001-06-07 10:09:24 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:41:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -451,7 +451,7 @@ #define RID_XPP_OVERBRACE (RID_APP_START + 3022) #define RID_XPP_UNDERBRACE (RID_APP_START + 3023) -#define RID_LOCALIZED_SYMBOL_NAMES (RID_APP_START + 3101) +#define RID_LOCALIZED_NAMES (RID_APP_START + 3101) #define RID_UI_SYMBOL_NAMES (RID_APP_START + 3102) #define RID_EXPORT_SYMBOL_NAMES (RID_APP_START + 3103) #define RID_LOCALIZED_SYMBOLSET_NAMES (RID_APP_START + 3104) diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index b0e4b930b120..98be0b3e8293 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mtg $ $Date: 2001-05-16 11:56:45 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:41:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,6 +98,9 @@ String GetExportSymbolName( const String &rUiSymbolName ); String GetUiSymbolName( const String &rExportSymbolName ); +String GetExportSymbolSetName( const String &rUiSymbolSetName ); +String GetUiSymbolSetName( const String &rExportSymbolSetName ); + //////////////////////////////////////////////////////////////////////////////// class SmSym @@ -132,9 +135,9 @@ public: sal_Unicode GetCharacter() const { return Character; } const String& GetName() const { return Name; } - Font& GetFace() { return Face; } - sal_Unicode& GetCharacter() { return Character; } - String& GetName() { return Name; } + void SetFace( const Font& rFont ) { Face = rFont; } + void SetCharacter( sal_Unicode cChar ) { Character = cChar; } + void SetName( const String &rTxt ) { Name = rTxt; } BOOL IsPredefined() const { return bPredefined; } const String & GetSetName() const { return aSetName; } @@ -162,10 +165,10 @@ class SmSymSet SmSymSetManager *pSymSetManager; public: - SmSymSet(); - SmSymSet(const SmSymSet& rSymbolSet); - SmSymSet(const String& rName); - ~SmSymSet(); + SmSymSet(); + SmSymSet(const SmSymSet& rSymbolSet); + SmSymSet(const String& rName); + ~SmSymSet(); SmSymSet& operator = (const SmSymSet& rSymbolSet); @@ -181,8 +184,6 @@ public: USHORT AddSymbol(SmSym* pSymbol); void DeleteSymbol(USHORT SymbolNo); - void RenameSymbol(USHORT SymbolNo, String& rName); - void ReplaceSymbol(USHORT SymbolNo, SmSym& rSymbol); SmSym * RemoveSymbol(USHORT SymbolNo); USHORT GetSymbolPos(const String& rName); }; diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 84bae351d8e9..a1e5429b4115 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgitem.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tl $ $Date: 2001-05-17 13:42:03 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:43:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -501,16 +501,22 @@ SmSym SmMathConfig::ReadSymbol( SmMathConfigItem &rCfg, if (bOK) { - String aUiName; + String aUiName( rSymbolName ); + String aUiSetName( aSet ); if (bPredefined) { - aUiName = GetUiSymbolName( rSymbolName ); - DBG_ASSERT( aUiName.Len(), "localized symbol-name not found" ); + String aTmp; + aTmp = GetUiSymbolName( rSymbolName ); + DBG_ASSERT( aTmp.Len(), "localized symbol-name not found" ); + if (aTmp.Len()) + aUiName = aTmp; + aTmp = GetUiSymbolSetName( aSet ); + DBG_ASSERT( aTmp.Len(), "localized symbolset-name not found" ); + if (aTmp.Len()) + aUiSetName = aTmp; } - if (!bPredefined || 0 == aUiName.Len()) - aUiName = rSymbolName; - aRes = SmSym( aUiName, aFont, cChar, aSet, bPredefined ); + aRes = SmSym( aUiName, aFont, cChar, aUiSetName, bPredefined ); if (aUiName != String(rSymbolName)) aRes.SetExportName( rSymbolName ); } @@ -608,7 +614,10 @@ void SmMathConfig::ReplaceSymbols( const SmSym *pNewSymbols[], USHORT nCount ) // Set pVal->Name = aNodeNameDelim; pVal->Name += *pName++; - pVal->Value <<= OUString( rSymbol.GetSetName() ); + OUString aTmp( rSymbol.GetSetName() ); + if (rSymbol.IsPredefined()) + aTmp = GetExportSymbolSetName( aTmp ); + pVal->Value <<= aTmp; pVal++; // Predefined pVal->Name = aNodeNameDelim; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index ab2291fd145b..6ae65e6434b3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fme $ $Date: 2001-06-15 06:42:09 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1910,14 +1910,14 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) DBG_ASSERT(pSym, "Sm : NULL pointer"); // Änderungen durchführen; - pSym->GetName() = aSymbols.GetText(); - pSym->GetFace() = aCharsetDisplay.GetFont(); - pSym->GetCharacter() = aCharsetDisplay.GetSelectChar(); + pSym->SetName( aSymbols.GetText() ); + pSym->SetFace( aCharsetDisplay.GetFont() ); + pSym->SetCharacter( aCharsetDisplay.GetSelectChar() ); // das SymbolSet wechseln wenn nötig if (pOldSymSet != pNewSymSet) { - pOldSymSet->RemoveSymbol(nSymbol); + pOldSymSet->DeleteSymbol(nSymbol); pNewSymSet->AddSymbol(pSym); } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index a04385d7840d..84aea982b8f1 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tl $ $Date: 2001-05-17 13:43:01 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,19 +128,26 @@ class SmMathConfigResource : public Resource { ResStringArray aUiSymbolNamesAry; ResStringArray aExportSymbolNamesAry; + ResStringArray aUiSymbolSetNamesAry; + ResStringArray aExportSymbolSetNamesAry; public: SmMathConfigResource(); ResStringArray& GetUiSymbolNamesArray() { return aUiSymbolNamesAry; } ResStringArray& GetExportSymbolNamesArray() { return aExportSymbolNamesAry; } + + ResStringArray& GetUiSymbolSetNamesArray() { return aUiSymbolSetNamesAry; } + ResStringArray& GetExportSymbolSetNamesArray() { return aExportSymbolSetNamesAry; } }; SmMathConfigResource::SmMathConfigResource() : - Resource( SmResId(RID_LOCALIZED_SYMBOL_NAMES) ), + Resource( SmResId(RID_LOCALIZED_NAMES) ), aUiSymbolNamesAry ( ResId(RID_UI_SYMBOL_NAMES) ), - aExportSymbolNamesAry ( ResId(RID_EXPORT_SYMBOL_NAMES) ) + aExportSymbolNamesAry ( ResId(RID_EXPORT_SYMBOL_NAMES) ), + aUiSymbolSetNamesAry ( ResId(RID_UI_SYMBOLSET_NAMES) ), + aExportSymbolSetNamesAry( ResId(RID_EXPORT_SYMBOLSET_NAMES) ) { FreeResource(); } @@ -190,6 +197,49 @@ String GetUiSymbolName( const String &rExportSymbolName ) return aRes; } +String GetExportSymbolSetName( const String &rUiSymbolSetName ) +{ + String aRes; + + SmMathConfigResource aCfgRes; + ResStringArray &rUiNames = aCfgRes.GetUiSymbolSetNamesArray(); + ResStringArray &rExportNames = aCfgRes.GetExportSymbolSetNamesArray(); + USHORT nCount = rUiNames.Count(); + + for (USHORT i = 0; i < nCount; ++i) + { + if (rUiSymbolSetName == rUiNames.GetString(i)) + { + aRes = rExportNames.GetString(i); + break; + } + } + + return aRes; +} + + +String GetUiSymbolSetName( const String &rExportSymbolSetName ) +{ + String aRes; + + SmMathConfigResource aCfgRes; + ResStringArray &rUiNames = aCfgRes.GetUiSymbolSetNamesArray(); + ResStringArray &rExportNames = aCfgRes.GetExportSymbolSetNamesArray(); + USHORT nCount = rExportNames.Count(); + + for (USHORT i = 0; i < nCount; ++i) + { + if (rExportSymbolSetName == rExportNames.GetString(i)) + { + aRes = rUiNames.GetString(i); + break; + } + } + + return aRes; +} + /**************************************************************************/ /* @@ -377,27 +427,6 @@ SmSym * SmSymSet::RemoveSymbol(USHORT SymbolNo) return pSym; } - -void SmSymSet::RenameSymbol(USHORT SymbolNo, String& rName) -{ - DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden"); - - SymbolList.GetObject(SymbolNo)->SetSymbolName(rName); - - if (pSymSetManager) - pSymSetManager->SetModified(TRUE); -} - -void SmSymSet::ReplaceSymbol(USHORT SymbolNo, SmSym& rSymbol) -{ - DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden"); - - *SymbolList.GetObject(SymbolNo) = rSymbol; - - if (pSymSetManager) - pSymSetManager->SetModified(TRUE); -} - USHORT SmSymSet::GetSymbolPos(const String& rName) { for (USHORT i = 0; i < GetCount(); i++) diff --git a/starmath/source/symbol.src b/starmath/source/symbol.src index e254f10e2e9a..9bcb26e0c8b5 100644 --- a/starmath/source/symbol.src +++ b/starmath/source/symbol.src @@ -2,9 +2,9 @@ * * $RCSfile: symbol.src,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: tl $ $Date: 2001-06-07 10:11:29 $ + * last change: $Author: tl $ $Date: 2001-06-22 12:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,7 +64,10 @@ ///////////////////////////////////////////////////////////////// -Resource RID_LOCALIZED_SYMBOLSET_NAMES + +///////////////////////////////////////////////////////////////// + +Resource RID_LOCALIZED_NAMES { StringArray RID_EXPORT_SYMBOLSET_NAMES { @@ -87,12 +90,7 @@ Resource RID_LOCALIZED_SYMBOLSET_NAMES < "Special" ; > ; }; }; -}; -///////////////////////////////////////////////////////////////// - -Resource RID_LOCALIZED_SYMBOL_NAMES -{ StringArray RID_EXPORT_SYMBOL_NAMES { ItemList = -- cgit v1.2.3 From 3acbf7b7361c18c408fde77aadd1956dd2680d34 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 11 Jul 2001 16:20:48 +0000 Subject: #65293#: includes --- starmath/source/dialog.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 6ae65e6434b3..ecf76a0dc4de 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tl $ $Date: 2001-06-22 12:43:05 $ + * last change: $Author: hr $ $Date: 2001-07-11 17:20:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,9 +73,6 @@ #ifndef _SFXINTITEM_HXX //autogen #include #endif -#ifndef _IODLG_HXX -#include -#endif #ifndef _SFXSTRITEM_HXX //autogen #include #endif -- cgit v1.2.3 From aa73f452d6c0446d6d22f9b0de6f88efb817b589 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 17 Jul 2001 07:28:21 +0000 Subject: #89759# StarMath font => StarSymbol font --- starmath/inc/dialog.hxx | 93 +++++--------- starmath/inc/format.hxx | 9 +- starmath/inc/types.hxx | 288 ++++++++++++++++++++++---------------------- starmath/source/cfgitem.cxx | 12 +- starmath/source/dialog.cxx | 163 +++---------------------- starmath/source/dialog.hrc | 7 +- starmath/source/node.cxx | 21 ++-- starmath/source/rect.cxx | 22 ++-- starmath/source/smres.src | 92 +++++++++----- starmath/source/symbol.cxx | 6 +- 10 files changed, 308 insertions(+), 405 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index f1f8224a9a7a..4a02c2caf52e 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: fme $ $Date: 2001-06-15 06:41:18 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,6 +79,9 @@ #ifndef _SV_COMBOBOX_HXX //autogen #include #endif +#ifndef _SVX_CHARMAP_HXX +#include +#endif #ifndef _SVX_OPTGENRL_HXX //autogen #include #endif @@ -447,38 +450,6 @@ public: void SelectSymbol(USHORT nSymbolNo); }; -/**************************************************************************/ - -class SmShowCharset : public Control -{ - Link aSelectHdlLink; - Link aDblClickHdlLink; - USHORT nLen; - USHORT nRows, nColumns; - xub_Unicode aChar; - - virtual void Paint(const Rectangle&); - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - virtual void KeyInput(const KeyEvent& rKEvt); - -public: - SmShowCharset(Window *pParent, const ResId& rResId); - - void SetSelectHdl(const Link& rLink) - { - aSelectHdlLink = rLink; - } - - void SetDblClickHdl(const Link& rLink) - { - aDblClickHdlLink = rLink; - } - - void SetFont(const Font &rFont); - void SelectChar(xub_Unicode aChar); - xub_Unicode GetSelectChar() const { return aChar; } -}; - //////////////////////////////////////////////////////////////////////////////// class SmShowChar : public Control @@ -499,31 +470,33 @@ public: class SmSymDefineDialog : public ModalDialog { - FixedText aOldSymbolText; - ComboBox aOldSymbols; - FixedText aOldSymbolSetText; - ComboBox aOldSymbolSets; - SmShowCharset aCharsetDisplay; - FixedText aSymbolText; - ComboBox aSymbols; - FixedText aSymbolSetText; - ComboBox aSymbolSets; - FixedText aFontText; - ListBox aFonts; - FixedText aStyleText; - FontStyleBox aStyles; - FixedText aOldSymbolName; - SmShowChar aOldSymbolDisplay; - FixedText aOldSymbolSetName; - FixedText aSymbolName; - SmShowChar aSymbolDisplay; - FixedText aSymbolSetName; - OKButton aOkBtn; - CancelButton aCancelBtn; - PushButton aAddBtn; - PushButton aChangeBtn; - PushButton aDeleteBtn; - FixedImage aRightArrow; + FixedText aOldSymbolText; + ComboBox aOldSymbols; + FixedText aOldSymbolSetText; + ComboBox aOldSymbolSets; + SvxShowCharSet aCharsetDisplay; + FixedText aSymbolText; + ComboBox aSymbols; + FixedText aSymbolSetText; + ComboBox aSymbolSets; + FixedText aFontText; + ListBox aFonts; + FixedText aFontsSubsetFT; + ListBox aFontsSubsetLB; + FixedText aStyleText; + FontStyleBox aStyles; + FixedText aOldSymbolName; + SmShowChar aOldSymbolDisplay; + FixedText aOldSymbolSetName; + FixedText aSymbolName; + SmShowChar aSymbolDisplay; + FixedText aSymbolSetName; + OKButton aOkBtn; + CancelButton aCancelBtn; + PushButton aAddBtn; + PushButton aChangeBtn; + PushButton aDeleteBtn; + FixedImage aRightArrow; SmSymSetManager aSymSetMgrCopy, &rSymSetMgr; @@ -536,7 +509,7 @@ class SmSymDefineDialog : public ModalDialog DECL_LINK(ModifyHdl, ComboBox *); DECL_LINK(FontChangeHdl, ListBox *); DECL_LINK(StyleChangeHdl, ComboBox *); - DECL_LINK(CharSelectHdl, SmShowCharset *); + DECL_LINK( CharHighlightHdl, Control* pControl ); DECL_LINK(AddClickHdl, Button *); DECL_LINK(ChangeClickHdl, Button *); DECL_LINK(DeleteClickHdl, Button *); diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 8ff06a603692..d9dec1a9aa16 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -2,9 +2,9 @@ * * $RCSfile: format.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2001-05-02 16:58:48 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,9 @@ #ifndef UTILITY_HXX #include "utility.hxx" #endif +#ifndef TYPES_HXX +#include +#endif #define SM_FMT_VERSION_51 ((BYTE) 0x01) @@ -84,7 +87,7 @@ #endif #define FNTNAME_HELV "Helvetica" #define FNTNAME_COUR "Courier" -#define FNTNAME_MATH "StarMath" +#define FNTNAME_MATH FONTNAME_MATH // symbolic names used as array indices diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx index c7aac531e8bf..de08a3907a9a 100644 --- a/starmath/inc/types.hxx +++ b/starmath/inc/types.hxx @@ -2,9 +2,9 @@ * * $RCSfile: types.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:57:25 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,153 +62,155 @@ #define TYPES_HXX -//////////////////////////////////////// -// enum definitions for characters from the 'StarMath' font +#define FONTNAME_MATH "StarSymbol" + +///////////////////////////////////////////////////////////////// +// enum definitions for characters from the 'StarSymbol' font // (some chars have more than one alias!) //! Note: not listed here does not(!) mean "not used" //! (see %alpha ... %gamma for example) // enum MathSymbol { - MS_FACT = (xub_Unicode) 0xF021, - MS_INFINITY = (xub_Unicode) 0xF027, - MS_SLASH = (xub_Unicode) 0xF02F, - - MS_NDIVIDES = (xub_Unicode) 0xF030, - MS_DRARROW = (xub_Unicode) 0xF031, - MS_DLARROW = (xub_Unicode) 0xF032, - MS_DLRARROW = (xub_Unicode) 0xF033, - MS_UNDERBRACE = (xub_Unicode) 0xF034, - MS_OVERBRACE = (xub_Unicode) 0xF035, - MS_CIRC = (xub_Unicode) 0xF036, - MS_ASSIGN = (xub_Unicode) 0xF03D, - MS_ERROR = (xub_Unicode) 0xF03F, - - MS_NEQ = (xub_Unicode) 0xF040, - MS_PLUS = (xub_Unicode) 0xF041, - MS_MINUS = (xub_Unicode) 0xF042, - MS_MULTIPLY = (xub_Unicode) 0xF043, - MS_TIMES = (xub_Unicode) 0xF044, - MS_CDOT = (xub_Unicode) 0xF045, - MS_DIV = (xub_Unicode) 0xF046, - MS_PLUSMINUS = (xub_Unicode) 0xF047, - MS_MINUSPLUS = (xub_Unicode) 0xF048, - MS_OPLUS = (xub_Unicode) 0xF049, - MS_OMINUS = (xub_Unicode) 0xF04A, - MS_OTIMES = (xub_Unicode) 0xF04B, - MS_ODIVIDE = (xub_Unicode) 0xF04C, - MS_ODOT = (xub_Unicode) 0xF04D, - MS_UNION = (xub_Unicode) 0xF04E, - MS_INTERSECT = (xub_Unicode) 0xF04F, - - MS_LT = (xub_Unicode) 0xF050, - MS_GT = (xub_Unicode) 0xF051, - MS_LE = (xub_Unicode) 0xF052, - MS_GE = (xub_Unicode) 0xF053, - MS_LESLANT = (xub_Unicode) 0xF054, - MS_GESLANT = (xub_Unicode) 0xF055, - MS_LL = (xub_Unicode) 0xF056, - MS_GG = (xub_Unicode) 0xF057, - MS_SIM = (xub_Unicode) 0xF058, - MS_SIMEQ = (xub_Unicode) 0xF059, - MS_APPROX = (xub_Unicode) 0xF05A, - MS_DEF = (xub_Unicode) 0xF05B, - MS_EQUIV = (xub_Unicode) 0xF05C, - MS_PROP = (xub_Unicode) 0xF05D, - MS_PARTIAL = (xub_Unicode) 0xF05E, - MS_SUBSET = (xub_Unicode) 0xF05F, - - MS_SUPSET = (xub_Unicode) 0xF060, - MS_SUBSETEQ = (xub_Unicode) 0xF061, - MS_SUPSETEQ = (xub_Unicode) 0xF062, - MS_NSUBSET = (xub_Unicode) 0xF063, - MS_NSUPSET = (xub_Unicode) 0xF064, - MS_NSUBSETEQ = (xub_Unicode) 0xF065, - MS_NSUPSETEQ = (xub_Unicode) 0xF066, - MS_IN = (xub_Unicode) 0xF067, - MS_NOTIN = (xub_Unicode) 0xF068, - MS_EXISTS = (xub_Unicode) 0xF06A, - MS_BACKEPSILON = (xub_Unicode) 0xF06B, - MS_ALEPH = (xub_Unicode) 0xF06C, - MS_IM = (xub_Unicode) 0xF06D, - MS_RE = (xub_Unicode) 0xF06E, - MS_WP = (xub_Unicode) 0xF06F, - - MS_LINE = (xub_Unicode) 0xF073, - MS_DLINE = (xub_Unicode) 0xF074, - MS_ORTHO = (xub_Unicode) 0xF075, - MS_DOTSLOW = (xub_Unicode) 0xF076, - MS_DOTSAXIS = (xub_Unicode) 0xF077, - MS_DOTSVERT = (xub_Unicode) 0xF078, - MS_DOTSUP = (xub_Unicode) 0xF079, - MS_DOTSDOWN = (xub_Unicode) 0xF07A, - MS_TRANSR = (xub_Unicode) 0xF07B, - MS_TRANSL = (xub_Unicode) 0xF07C, - MS_RIGHTARROW = (xub_Unicode) 0xF07D, - MS_BACKSLASH = (xub_Unicode) 0xF07E, - MS_NEG = (xub_Unicode) 0xF07F, - - MS_INT = (xub_Unicode) 0xF080, - MS_IINT = (xub_Unicode) 0xF081, - MS_IIINT = (xub_Unicode) 0xF082, - MS_LINT = (xub_Unicode) 0xF083, - MS_LLINT = (xub_Unicode) 0xF084, - MS_LLLINT = (xub_Unicode) 0xF085, - MS_SQRT = (xub_Unicode) 0xF087, - MS_SQRT2 = (xub_Unicode) 0xF089, - MS_COPROD = (xub_Unicode) 0xF08A, - MS_PROD = (xub_Unicode) 0xF08B, - MS_SUM = (xub_Unicode) 0xF08C, - MS_NABLA = (xub_Unicode) 0xF08D, - MS_FORALL = (xub_Unicode) 0xF08E, - - MS_HAT = (xub_Unicode) 0xF090, - MS_CHECK = (xub_Unicode) 0xF091, - MS_BREVE = (xub_Unicode) 0xF092, - MS_ACUTE = (xub_Unicode) 0xF093, - MS_GRAVE = (xub_Unicode) 0xF094, - MS_TILDE = (xub_Unicode) 0xF095, - MS_BAR = (xub_Unicode) 0xF096, - MS_VEC = (xub_Unicode) 0xF097, - MS_DOT = (xub_Unicode) 0xF098, - MS_DDOT = (xub_Unicode) 0xF099, - MS_DDDOT = (xub_Unicode) 0xF09A, - MS_CIRCLE = (xub_Unicode) 0xF09B, - MS_AND = (xub_Unicode) 0xF09C, - MS_OR = (xub_Unicode) 0xF09D, - MS_NI = (xub_Unicode) 0xF09E, - MS_EMPTYSET = (xub_Unicode) 0xF09F, - - MS_LBRACE = (xub_Unicode) 0xF0A0, - MS_RBRACE = (xub_Unicode) 0xF0A1, - MS_LPARENT = (xub_Unicode) 0xF0A2, - MS_RPARENT = (xub_Unicode) 0xF0A3, - MS_LANGLE = (xub_Unicode) 0xF0A4, - MS_RANGLE = (xub_Unicode) 0xF0A5, - MS_LBRACKET = (xub_Unicode) 0xF0A6, - MS_RBRACKET = (xub_Unicode) 0xF0A7, - - MS_LDBRACKET = (xub_Unicode) 0xF0B2, - MS_RDBRACKET = (xub_Unicode) 0xF0B3, - MS_PLACE = (xub_Unicode) 0xF0BF, - - MS_LCEIL = (xub_Unicode) 0xF0C0, - MS_LFLOOR = (xub_Unicode) 0xF0C1, - MS_RCEIL = (xub_Unicode) 0xF0C2, - MS_RFLOOR = (xub_Unicode) 0xF0C3, - MS_SQRT2_X = (xub_Unicode) 0xF0C5, - - MS_TOP = (xub_Unicode) 0xF0F5, - MS_HBAR = (xub_Unicode) 0xF0F6, - MS_LAMBDABAR = (xub_Unicode) 0xF0F7, - MS_LEFTARROW = (xub_Unicode) 0xF0F8, - MS_UPARROW = (xub_Unicode) 0xF0F9, - MS_DOWNARROW = (xub_Unicode) 0xF0FA, - MS_SETN = (xub_Unicode) 0xF0FB, - MS_SETZ = (xub_Unicode) 0xF0FC, - MS_SETQ = (xub_Unicode) 0xF0FD, - MS_SETR = (xub_Unicode) 0xF0FE, - MS_SETC = (xub_Unicode) 0xF0FF + MS_FACT = (xub_Unicode) 0x0021, + MS_INFINITY = (xub_Unicode) 0x221E, + MS_SLASH = (xub_Unicode) 0x002F, + + MS_NDIVIDES = (xub_Unicode) 0x2224, + MS_DRARROW = (xub_Unicode) 0x21D2, + MS_DLARROW = (xub_Unicode) 0x21D0, + MS_DLRARROW = (xub_Unicode) 0x21D4, + MS_UNDERBRACE = (xub_Unicode) 0xE081, + MS_OVERBRACE = (xub_Unicode) 0xE082, + MS_CIRC = (xub_Unicode) 0x00B0, + MS_ASSIGN = (xub_Unicode) 0x003D, + MS_ERROR = (xub_Unicode) 0x00BF, + + MS_NEQ = (xub_Unicode) 0x2260, + MS_PLUS = (xub_Unicode) 0xE083, + MS_MINUS = (xub_Unicode) 0x2212, + MS_MULTIPLY = (xub_Unicode) 0x2217, + MS_TIMES = (xub_Unicode) 0x00D7, + MS_CDOT = (xub_Unicode) 0x2219, + MS_DIV = (xub_Unicode) 0x00F7, + MS_PLUSMINUS = (xub_Unicode) 0x00B1, + MS_MINUSPLUS = (xub_Unicode) 0x2213, + MS_OPLUS = (xub_Unicode) 0x2295, + MS_OMINUS = (xub_Unicode) 0x2296, + MS_OTIMES = (xub_Unicode) 0x2297, + MS_ODIVIDE = (xub_Unicode) 0x2298, + MS_ODOT = (xub_Unicode) 0x2299, + MS_UNION = (xub_Unicode) 0x222A, + MS_INTERSECT = (xub_Unicode) 0x2229, + + MS_LT = (xub_Unicode) 0xE084, + MS_GT = (xub_Unicode) 0xE085, + MS_LE = (xub_Unicode) 0x2264, + MS_GE = (xub_Unicode) 0x2265, + MS_LESLANT = (xub_Unicode) 0xE086, + MS_GESLANT = (xub_Unicode) 0xE087, + MS_LL = (xub_Unicode) 0x226A, + MS_GG = (xub_Unicode) 0x226B, + MS_SIM = (xub_Unicode) 0x007E, + MS_SIMEQ = (xub_Unicode) 0x2243, + MS_APPROX = (xub_Unicode) 0x2248, + MS_DEF = (xub_Unicode) 0x225D, + MS_EQUIV = (xub_Unicode) 0x2261, + MS_PROP = (xub_Unicode) 0x221D, + MS_PARTIAL = (xub_Unicode) 0x2202, + MS_SUBSET = (xub_Unicode) 0x2282, + + MS_SUPSET = (xub_Unicode) 0x2283, + MS_SUBSETEQ = (xub_Unicode) 0x2286, + MS_SUPSETEQ = (xub_Unicode) 0x2287, + MS_NSUBSET = (xub_Unicode) 0x2284, + MS_NSUPSET = (xub_Unicode) 0x2285, + MS_NSUBSETEQ = (xub_Unicode) 0x2288, + MS_NSUPSETEQ = (xub_Unicode) 0x2289, + MS_IN = (xub_Unicode) 0x2208, + MS_NOTIN = (xub_Unicode) 0x2209, + MS_EXISTS = (xub_Unicode) 0x2203, + MS_BACKEPSILON = (xub_Unicode) 0x220D, + MS_ALEPH = (xub_Unicode) 0x2135, + MS_IM = (xub_Unicode) 0x2111, + MS_RE = (xub_Unicode) 0x211C, + MS_WP = (xub_Unicode) 0x2118, + + MS_LINE = (xub_Unicode) 0x2223, + MS_DLINE = (xub_Unicode) 0x2225, + MS_ORTHO = (xub_Unicode) 0x22A5, + MS_DOTSLOW = (xub_Unicode) 0xE08B, + MS_DOTSAXIS = (xub_Unicode) 0x22EF, + MS_DOTSVERT = (xub_Unicode) 0x22EE, + MS_DOTSUP = (xub_Unicode) 0x22F0, + MS_DOTSDOWN = (xub_Unicode) 0x22F1, + MS_TRANSR = (xub_Unicode) 0x22B6, + MS_TRANSL = (xub_Unicode) 0x22B7, + MS_RIGHTARROW = (xub_Unicode) 0xE08C, + MS_BACKSLASH = (xub_Unicode) 0x2216, + MS_NEG = (xub_Unicode) 0x00AC, + + MS_INT = (xub_Unicode) 0x222B, + MS_IINT = (xub_Unicode) 0x222C, + MS_IIINT = (xub_Unicode) 0x222D, + MS_LINT = (xub_Unicode) 0x222E, + MS_LLINT = (xub_Unicode) 0x222F, + MS_LLLINT = (xub_Unicode) 0x2230, + MS_SQRT = (xub_Unicode) 0xE08D, + MS_SQRT2 = (xub_Unicode) 0xE08F, + MS_COPROD = (xub_Unicode) 0x2210, + MS_PROD = (xub_Unicode) 0x220F, + MS_SUM = (xub_Unicode) 0x2211, + MS_NABLA = (xub_Unicode) 0x2207, + MS_FORALL = (xub_Unicode) 0x2200, + + MS_HAT = (xub_Unicode) 0xE091, + MS_CHECK = (xub_Unicode) 0xE092, + MS_BREVE = (xub_Unicode) 0xE093, + MS_ACUTE = (xub_Unicode) 0xE094, + MS_GRAVE = (xub_Unicode) 0xE095, + MS_TILDE = (xub_Unicode) 0xE096, + MS_BAR = (xub_Unicode) 0xE097, + MS_VEC = (xub_Unicode) 0xE098, + MS_DOT = (xub_Unicode) 0xE099, + MS_DDOT = (xub_Unicode) 0xE09A, + MS_DDDOT = (xub_Unicode) 0xE09B, + MS_CIRCLE = (xub_Unicode) 0xE09C, + MS_AND = (xub_Unicode) 0x2227, + MS_OR = (xub_Unicode) 0x2228, + MS_NI = (xub_Unicode) 0x220B, + MS_EMPTYSET = (xub_Unicode) 0x2205, + + MS_LBRACE = (xub_Unicode) 0x007B, + MS_RBRACE = (xub_Unicode) 0x007D, + MS_LPARENT = (xub_Unicode) 0xE09E, + MS_RPARENT = (xub_Unicode) 0xE09F, + MS_LANGLE = (xub_Unicode) 0x2329, + MS_RANGLE = (xub_Unicode) 0x232A, + MS_LBRACKET = (xub_Unicode) 0x005B, + MS_RBRACKET = (xub_Unicode) 0x005D, + + MS_LDBRACKET = (xub_Unicode) 0xE0A2, + MS_RDBRACKET = (xub_Unicode) 0xE0A3, + MS_PLACE = (xub_Unicode) 0xE0AA, + + MS_LCEIL = (xub_Unicode) 0x2308, + MS_LFLOOR = (xub_Unicode) 0x230A, + MS_RCEIL = (xub_Unicode) 0x2309, + MS_RFLOOR = (xub_Unicode) 0x230B, + MS_SQRT2_X = (xub_Unicode) 0xE0AB, + + MS_TOP = (xub_Unicode) 0xE0D9, + MS_HBAR = (xub_Unicode) 0x210F, + MS_LAMBDABAR = (xub_Unicode) 0xE0DA, + MS_LEFTARROW = (xub_Unicode) 0xE0DB, + MS_UPARROW = (xub_Unicode) 0xE0DC, + MS_DOWNARROW = (xub_Unicode) 0xE0DD, + MS_SETN = (xub_Unicode) 0x2115, + MS_SETZ = (xub_Unicode) 0x2124, + MS_SETQ = (xub_Unicode) 0x211A, + MS_SETR = (xub_Unicode) 0x211D, + MS_SETC = (xub_Unicode) 0x2102 }; diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 236ee0aafd1f..1a1b32ae8a87 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgitem.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tl $ $Date: 2001-07-06 14:23:03 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -264,8 +264,12 @@ SmCfgOther::SmCfgOther() SmFontFormat::SmFontFormat() { - aName.AssignAscii( "StarMath" ); - nCharSet = nFamily = nPitch = nWeight = nItalic = 0; + aName.AssignAscii( FONTNAME_MATH ); + nCharSet = RTL_TEXTENCODING_UNICODE; + nFamily = FAMILY_DONTKNOW; + nPitch = PITCH_DONTKNOW; + nWeight = WEIGHT_DONTKNOW; + nItalic = ITALIC_NONE; } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index ecf76a0dc4de..2a572871def6 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: hr $ $Date: 2001-07-11 17:20:48 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1510,136 +1510,6 @@ const SmSym * SmSymbolDialog::GetSymbol() const } -/**************************************************************************/ - - -void SmShowCharset::Paint(const Rectangle&) -{ - Size OutputSize = GetOutputSizePixel(); - - int i; - for (i = 1; i < (int) nColumns; i++) - { - int nLenI = nLen * i; - - DrawLine(Point(nLenI, 0), Point(nLenI, OutputSize.Height())); - } - - for (i = 1; i < (int) nRows; i++) - { - int nLenI = nLen * i; - - DrawLine(Point(0, nLenI), Point(OutputSize.Width(), nLenI)); - } - - for (i = 1; i < 256; i++) - { - int x = (i % nColumns) * nLen; - int y = (i / nColumns) * nLen; - - XubString aChar((xub_Unicode) i); - Size aTextSize(GetTextWidth(aChar), GetTextHeight()); - - DrawText(Point(x + (nLen - aTextSize.Width()) / 2, - y + (nLen - aTextSize.Height()) / 2), aChar); - } -} - - -void SmShowCharset::MouseButtonDown(const MouseEvent& rMEvt) -{ - if (rMEvt.IsLeft()) - { - GrabFocus(); - - USHORT n = (USHORT) ((rMEvt.GetPosPixel().Y() / nLen) * nColumns + - (rMEvt.GetPosPixel().X() / nLen)); - SelectChar((xub_Unicode)Min((USHORT) n, (USHORT) 255)); - - aSelectHdlLink.Call(this); - - if (rMEvt.GetClicks() > 1) - aDblClickHdlLink.Call(this); - } - else Control::MouseButtonDown (rMEvt); -} - - -void SmShowCharset::KeyInput(const KeyEvent& rKEvt) -{ - xub_Unicode n = aChar; - - switch (rKEvt.GetKeyCode().GetCode()) - { - case KEY_DOWN: n += (xub_Unicode) nColumns; break; - case KEY_UP: n -= (xub_Unicode) nColumns; break; - case KEY_LEFT: n -= 1; break; - case KEY_RIGHT: n += 1; break; - case KEY_HOME: n = 0; break; - case KEY_END: n = (xub_Unicode) 255; break; - case KEY_PAGEUP: n -= (xub_Unicode) nColumns; break; - case KEY_PAGEDOWN: n += (xub_Unicode) nColumns; break; - - default: - Control::KeyInput(rKEvt); - return; - } - - SelectChar(n); - aSelectHdlLink.Call(this); -} - - -SmShowCharset::SmShowCharset(Window *pParent, const ResId& rResId) : - Control(pParent, rResId) -{ - aChar = xub_Unicode('\0'); - - Size aOutputSize (GetOutputSizePixel()); - - nColumns = 32; - nRows = 8; - - // FontSize passend wählen - nLen = Min(aOutputSize.Width() / nColumns, aOutputSize.Height() / nRows); - - // Fenster genau passend machen (wird höchstens kleiner!) - aOutputSize.Width() = nColumns * nLen; - aOutputSize.Height() = nRows * nLen; - - SetOutputSizePixel(aOutputSize); -} - - -void SmShowCharset::SetFont(const Font &rFont) -{ - Font aFont (rFont); - - // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben - // (hofentlich auch genug für links und rechts) - aFont.SetSize(Size(0, nLen - (nLen / 3))); - aFont.SetTransparent(TRUE); - Control::SetFont(aFont); - - Invalidate(); -} - - -void SmShowCharset::SelectChar(xub_Unicode aCharP) -{ - int c = aChar & 0xFF; - Size aNSize (nLen, nLen); - - Invalidate(Rectangle(Point((c % nColumns) * nLen, (c / nColumns) * nLen), aNSize)); - - aChar = aCharP; - c = aChar & 0xFF; - Invalidate(Rectangle(Point((c % nColumns) * nLen, (c / nColumns) * nLen), aNSize)); - - Update(); -} - - //////////////////////////////////////////////////////////////////////////////// @@ -1834,14 +1704,18 @@ IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) } -IMPL_LINK_INLINE_START( SmSymDefineDialog, CharSelectHdl, SmShowCharset *, pShowCharset ) +IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) { - DBG_ASSERT(pShowCharset == &aCharsetDisplay, "Sm : falsches Argument"); - - SelectChar(aCharsetDisplay.GetSelectChar()); + sal_Unicode cChar = aCharsetDisplay.GetSelectCharacter(); +/* + const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); + if (pSubset) + aFontsSubsetLB.SelectEntry( pSubset->GetName() ); +*/ + aSymbolDisplay.SetChar( cChar ); + UpdateButtons(); return 0; } -IMPL_LINK_INLINE_END( SmSymDefineDialog, CharSelectHdl, SmShowCharset *, pShowCharset ) IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) @@ -1863,7 +1737,7 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) // Symbol ins SymbolSet einfügen SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(), - aCharsetDisplay.GetSelectChar(), + aCharsetDisplay.GetSelectCharacter(), aSymbolSets.GetText()); pSymSet->AddSymbol(pSym); @@ -1903,13 +1777,14 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) // das (alte) Symbol besorgen USHORT nSymbol = pOldSymSet->GetSymbolPos(aOldSymbols.GetText()); + DBG_ASSERT( SYMBOL_NONE != nSymbol, "symbol not found" ); SmSym *pSym = (SmSym *) &pOldSymSet->GetSymbol(nSymbol); DBG_ASSERT(pSym, "Sm : NULL pointer"); // Änderungen durchführen; pSym->SetName( aSymbols.GetText() ); pSym->SetFace( aCharsetDisplay.GetFont() ); - pSym->SetCharacter( aCharsetDisplay.GetSelectChar() ); + pSym->SetCharacter( aCharsetDisplay.GetSelectCharacter() ); // das SymbolSet wechseln wenn nötig if (pOldSymSet != pNewSymSet) @@ -1988,7 +1863,7 @@ void SmSymDefineDialog::UpdateButtons() && aSymbolName.Equals(pOrigSymbol->GetName()) && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii(pOrigSymbol->GetFace().GetName()) && aStyles.GetText().EqualsIgnoreCaseAscii(GetFontStyleName(pOrigSymbol->GetFace())) - && aCharsetDisplay.GetSelectChar() == pOrigSymbol->GetCharacter(); + && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); // hinzufügen nur wenn es noch kein Symbol desgleichen Namens gibt bAdd = aSymSetMgrCopy.GetSymbol(aSymbolName) == NULL; @@ -2022,6 +1897,8 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO aSymbolSets (this, ResId(5)), aFontText (this, ResId(3)), aFonts (this, ResId(1)), + aFontsSubsetFT (this, ResId( FT_FONTS_SUBSET )), + aFontsSubsetLB (this, ResId( LB_FONTS_SUBSET )), aStyleText (this, ResId(4)), aStyles (this, ResId(3)), aOldSymbolName (this, ResId(7)), @@ -2081,7 +1958,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO aAddBtn .SetClickHdl (LINK(this, SmSymDefineDialog, AddClickHdl)); aChangeBtn .SetClickHdl (LINK(this, SmSymDefineDialog, ChangeClickHdl)); aDeleteBtn .SetClickHdl (LINK(this, SmSymDefineDialog, DeleteClickHdl)); - aCharsetDisplay.SetSelectHdl(LINK(this, SmSymDefineDialog, CharSelectHdl)); + aCharsetDisplay.SetHighlightHdl( LINK( this, SmSymDefineDialog, CharHighlightHdl ) ); } @@ -2346,8 +2223,8 @@ BOOL SmSymDefineDialog::SelectStyle(const XubString &rStyleName, BOOL bApplyFont void SmSymDefineDialog::SelectChar(xub_Unicode cChar) { - aCharsetDisplay.SelectChar(cChar); - aSymbolDisplay.SetChar(cChar); + aCharsetDisplay.SelectCharacter( cChar ); + aSymbolDisplay.SetChar( cChar ); UpdateButtons(); } diff --git a/starmath/source/dialog.hrc b/starmath/source/dialog.hrc index a27b0ba8771e..94a95eeec450 100644 --- a/starmath/source/dialog.hrc +++ b/starmath/source/dialog.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hrc,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: fme $ $Date: 2001-06-15 06:42:09 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,3 +73,6 @@ #define FL_MISC_OPTIONS 30 #define CB_IGNORE_SPACING 31 +#define FT_FONTS_SUBSET 110 +#define LB_FONTS_SUBSET 111 + diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 09068fb5c761..368193119681 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2,9 +2,9 @@ * * $RCSfile: node.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: tl $ $Date: 2001-06-28 13:51:13 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1779,8 +1779,7 @@ long SmOperNode::CalcSymbolHeight(const SmNode &rSymbol, nHeight = nHeight * 686L / 845L; } - // correct user-defined symbols to match height of sum from StarMath - // font + // correct user-defined symbols to match height of sum from used font if (rSymbol.GetToken().eType == TSPECIAL) nHeight = nHeight * 845L / 686L; @@ -2672,8 +2671,9 @@ void SmMathSymbolNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocSh { SmNode::Prepare(rFormat, rDocShell); - DBG_ASSERT(GetFont().GetCharSet() == RTL_TEXTENCODING_SYMBOL, - "Sm : falsches CHARSET für Zeichen aus dem StarMath Font"); + DBG_ASSERT(GetFont().GetCharSet() == RTL_TEXTENCODING_SYMBOL || + GetFont().GetCharSet() == RTL_TEXTENCODING_UNICODE, + "incorrect charset for character from StarMath/StarSymbol font"); Flags() |= FLG_FONT | FLG_ITALIC; }; @@ -2722,14 +2722,13 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell Size aOldSize = GetFont().GetSize(); if (pSym = rDocShell.GetSymSetManager().GetSymbol(GetToken().aText)) - { SetText( pSym->GetCharacter() ); + { + SetText( pSym->GetCharacter() ); GetFont() = pSym->GetFace(); - - if (GetFont().GetName().EqualsIgnoreCaseAscii("StarMath")) - GetFont().SetCharSet(RTL_TEXTENCODING_SYMBOL); } else - { SetText( GetToken().aText ); + { + SetText( GetToken().aText ); GetFont() = rFormat.GetFont(FNT_VARIABLE); } GetFont().SetSize(aOldSize); diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 823696e9d3b5..115163776fb5 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: rect.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tl $ $Date: 2000-10-12 08:25:53 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,12 +93,14 @@ // und Symbolen ein "normales"(ungecliptes) SmRect zu erhalten). static xub_Unicode __READONLY_DATA aMathAlpha[] = { - MS_ALEPH, MS_IM, MS_RE, MS_WP, - xub_Unicode('\x70'), MS_EMPTYSET, xub_Unicode('\xF0'), xub_Unicode('\xF1'), - xub_Unicode('\xF2'), xub_Unicode('\xF3'), xub_Unicode('\xF4'), MS_HBAR, - MS_LAMBDABAR, MS_SETN, MS_SETZ, MS_SETQ, - MS_SETR, MS_SETC, xub_Unicode('\xB4'), xub_Unicode('\xB5'), - xub_Unicode('\xB8'), xub_Unicode('\xB9'), xub_Unicode('\xBA'), + MS_ALEPH, MS_IM, MS_RE, + MS_WP, xub_Unicode(0xE070), MS_EMPTYSET, + xub_Unicode(0x2113), xub_Unicode(0xE0D6), xub_Unicode(0xE0D7), + xub_Unicode(0xE0D8), xub_Unicode(0x210A), MS_HBAR, + MS_LAMBDABAR, MS_SETN, MS_SETZ, + MS_SETQ, MS_SETR, MS_SETC, + xub_Unicode(0xE0A4), xub_Unicode(0xE0A5), xub_Unicode(0x2112), + xub_Unicode(0x2130), xub_Unicode(0x2131), xub_Unicode('\0') }; @@ -113,7 +115,7 @@ BOOL SmIsMathAlpha(const XubString &rText) xub_Unicode cChar = rText.GetChar(0); // ist es ein griechisches Zeichen ? - if (xub_Unicode('\xC6') <= cChar && cChar <= xub_Unicode('\xEE')) + if (xub_Unicode(0xE0AC) <= cChar && cChar <= xub_Unicode(0xE0D4)) return TRUE; else { @@ -191,7 +193,7 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, aSize = Size(rDev.GetTextWidth(rText), rDev.GetTextHeight()); const FontMetric aFM (rDev.GetFontMetric()); - BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii("StarMath"); + BOOL bIsMath = aFM.GetName().EqualsIgnoreCaseAscii( FONTNAME_MATH ); BOOL bAllowSmaller = bIsMath && !SmIsMathAlpha(rText); const long nFontHeight = rDev.GetFont().GetSize().Height(); diff --git a/starmath/source/smres.src b/starmath/source/smres.src index ed41b5d5a8d4..a4e14278e6de 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -2,9 +2,9 @@ * * $RCSfile: smres.src,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: kz $ $Date: 2001-07-13 20:45:00 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3014,7 +3014,7 @@ ModalDialog RID_SYMDEFINEDIALOG Moveable = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 365 , 195 ) ; + Size = MAP_APPFONT ( 365 , 215 ) ; Text = "Symbole bearbeiten" ; Text [ ENGLISH ] = "Edit symbols" ; Text[ chinese_simplified ] = "±à¼­Í¼±ê"; @@ -3034,6 +3034,11 @@ ModalDialog RID_SYMDEFINEDIALOG Text [ dutch ] = "Symbolen bewerken" ; Text [ spanish ] = "Editar símbolos" ; Text [ english_us ] = "Edit Symbols" ; + Text[ greek ] = "Åðåîåñãáóßá óõìâüëùí"; + Text[ korean ] = "±âÈ£ ÆíÁý"; + Text[ turkish ] = "Simgeleri düzenle"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Editar símbolos"; FixedText 1 { Pos = MAP_APPFONT ( 6 , 8 ) ; @@ -3110,12 +3115,13 @@ ModalDialog RID_SYMDEFINEDIALOG { Border = TRUE ; Pos = MAP_APPFONT ( 6 , 24 ) ; - Size = MAP_APPFONT ( 295 , 90 ) ; + Size = MAP_APPFONT ( 295 , 87 ) ; TabStop = TRUE ; + Group = TRUE ; }; FixedText 9 { - Pos = MAP_APPFONT ( 6 , 113 ) ; + Pos = MAP_APPFONT ( 6 , 118 ) ; Size = MAP_APPFONT ( 56 , 10 ) ; Text = "~Symbol" ; Text [ English ] = "~Symbol" ; @@ -3143,7 +3149,7 @@ ModalDialog RID_SYMDEFINEDIALOG }; ComboBox 4 { - Pos = MAP_APPFONT ( 70 , 110 ) ; + Pos = MAP_APPFONT ( 70 , 115 ) ; Size = MAP_APPFONT ( 100 , 80 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -3152,7 +3158,7 @@ ModalDialog RID_SYMDEFINEDIALOG FixedText 10 { Left = TRUE ; - Pos = MAP_APPFONT ( 6 , 128 ) ; + Pos = MAP_APPFONT ( 6 , 133 ) ; Size = MAP_APPFONT ( 56 , 10 ) ; Text = "S~ymbolset" ; Text [ English ] = "S~ymbolset" ; @@ -3179,7 +3185,7 @@ ModalDialog RID_SYMDEFINEDIALOG }; ComboBox 5 { - Pos = MAP_APPFONT ( 70 , 125 ) ; + Pos = MAP_APPFONT ( 70 , 130 ) ; Size = MAP_APPFONT ( 100 , 50 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -3188,7 +3194,7 @@ ModalDialog RID_SYMDEFINEDIALOG FixedText 3 { Left = TRUE ; - Pos = MAP_APPFONT ( 6 , 143 ) ; + Pos = MAP_APPFONT ( 6 , 148 ) ; Size = MAP_APPFONT ( 56 , 10 ) ; Text = "Schri~ftart" ; Text [ ENGLISH ] = "~Font" ; @@ -3216,16 +3222,53 @@ ModalDialog RID_SYMDEFINEDIALOG ListBox 1 { Border = TRUE ; - Pos = MAP_APPFONT ( 70 , 140 ) ; + Pos = MAP_APPFONT ( 70 , 145 ) ; Size = MAP_APPFONT ( 100 , 50 ) ; TabStop = TRUE ; Sort = TRUE ; DropDown = TRUE ; }; + FixedText FT_FONTS_SUBSET + { + Left = TRUE ; + Pos = MAP_APPFONT ( 6 , 163 ) ; + Size = MAP_APPFONT ( 56 , 10 ) ; + Text = "~Bereich" ; + Text [ ENGLISH ] = "~Subset" ; + Text[ english_us ] = "~Subset"; + Text[ portuguese ] = "~Subconjunto"; + Text[ russian ] = "~Íàáîð ñèìâîëîâ"; + Text[ greek ] = "Ðåñéï÷Þ"; + Text[ dutch ] = "~Bereik"; + Text[ french ] = "~Sous-ensemble"; + Text[ spanish ] = "~Área"; + Text[ italian ] = "So~ttoinsieme"; + Text[ danish ] = "~Subset"; + Text[ swedish ] = "~Område"; + Text[ polish ] = "~Obszar"; + Text[ portuguese_brazilian ] = "~Subset"; + Text[ japanese ] = "Ží—Þ(~S)"; + Text[ korean ] = "¹üÀ§(~S)"; + Text[ chinese_simplified ] = "×Ó¼¯(~S)"; + Text[ chinese_traditional ] = "¤l¶°(~S)"; + Text[ turkish ] = "~Subset"; + Text[ arabic ] = "ãÌãæÚÉ ÌÒÆíÉ"; + Text[ catalan ] = "~Área"; + Text[ finnish ] = "~Alijoukko"; + }; + ListBox LB_FONTS_SUBSET + { + Border = TRUE ; + Pos = MAP_APPFONT ( 70 , 160 ) ; + Size = MAP_APPFONT ( 100 , 50 ) ; + TabStop = TRUE ; + Sort = FALSE ; + DropDown = TRUE ; + }; FixedText 4 { Left = TRUE ; - Pos = MAP_APPFONT ( 6 , 158 ) ; + Pos = MAP_APPFONT ( 6 , 178 ) ; Size = MAP_APPFONT ( 56 , 10 ) ; Text = "Schriftschni~tt" ; Text [ ENGLISH ] = "S~tyle" ; @@ -3253,7 +3296,7 @@ ModalDialog RID_SYMDEFINEDIALOG ComboBox 3 { Border = TRUE; - Pos = MAP_APPFONT ( 70 , 155 ) ; + Pos = MAP_APPFONT ( 70 , 175 ) ; Size = MAP_APPFONT ( 100 , 50 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -3262,24 +3305,24 @@ ModalDialog RID_SYMDEFINEDIALOG FixedText 5 { Left = TRUE ; - Pos = MAP_APPFONT ( 310 , 110 ) ; + Pos = MAP_APPFONT ( 310 , 130 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; }; Control 2 { Border = TRUE ; - Pos = MAP_APPFONT ( 310 , 120 ) ; + Pos = MAP_APPFONT ( 310 , 140 ) ; Size = MAP_APPFONT ( 40 , 40 ) ; }; FixedText 6 { Left = TRUE ; - Pos = MAP_APPFONT ( 310 , 160 ) ; + Pos = MAP_APPFONT ( 310 , 180 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; }; FixedImage BMP_ARROW_RIGHT { - Pos = MAP_APPFONT ( 252 , 122 ) ; + Pos = MAP_APPFONT ( 252 , 142 ) ; Size = MAP_APPFONT ( 36 , 36 ) ; Fixed = Image @@ -3291,25 +3334,25 @@ ModalDialog RID_SYMDEFINEDIALOG FixedText 7 { Left = TRUE ; - Pos = MAP_APPFONT ( 190 , 110 ) ; + Pos = MAP_APPFONT ( 190 , 130 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; }; Control 3 { Border = TRUE ; - Pos = MAP_APPFONT ( 190 , 120 ) ; + Pos = MAP_APPFONT ( 190 , 140 ) ; Size = MAP_APPFONT ( 40 , 40 ) ; }; FixedText 8 { Left = TRUE ; - Pos = MAP_APPFONT ( 190 , 160 ) ; + Pos = MAP_APPFONT ( 190 , 180 ) ; Size = MAP_APPFONT ( 40 , 10 ) ; }; PushButton 1 { TabStop = TRUE ; - Pos = MAP_APPFONT ( 305 , 175 ) ; + Pos = MAP_APPFONT ( 305 , 195 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text = "H~inzufügen" ; Text [ ENGLISH ] = "~Add" ; @@ -3339,7 +3382,7 @@ ModalDialog RID_SYMDEFINEDIALOG PushButton 2 { TabStop = TRUE ; - Pos = MAP_APPFONT ( 245 , 175 ) ; + Pos = MAP_APPFONT ( 245 , 195 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text = "Ä~ndern" ; Text [ ENGLISH ] = "~Change" ; @@ -3369,7 +3412,7 @@ ModalDialog RID_SYMDEFINEDIALOG PushButton 3 { TabStop = TRUE ; - Pos = MAP_APPFONT ( 185 , 175 ) ; + Pos = MAP_APPFONT ( 185 , 195 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text = "~Löschen" ; Text [ ENGLISH ] = "~Delete" ; @@ -3409,11 +3452,6 @@ ModalDialog RID_SYMDEFINEDIALOG Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; }; - Text[ greek ] = "Åðåîåñãáóßá óõìâüëùí"; - Text[ korean ] = "±âÈ£ ÆíÁý"; - Text[ turkish ] = "Simgeleri düzenle"; - Text[ language_user1 ] = " "; - Text[ catalan ] = "Editar símbolos"; }; WarningBox RID_NOMATHTYPEFACEWARNING diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 52c0571e0cd6..a8761f12e69a 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: tl $ $Date: 2001-06-29 08:43:40 $ + * last change: $Author: tl $ $Date: 2001-07-17 08:28:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -281,6 +281,8 @@ SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar, Name = aExportName = rName; Face = rFont; Character = aChar; + if (RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet()) + Character |= 0xF000; aSetName = rSet; bPredefined = bIsPredefined; bDocSymbol = FALSE; -- cgit v1.2.3 From 7e9e2691de04fa711ef2099804245a9e58de7a36 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 23 Jul 2001 07:56:32 +0000 Subject: #89759# font subset functionality added --- starmath/source/dialog.cxx | 64 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 7 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 2a572871def6..b651012472af 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tl $ $Date: 2001-07-17 08:28:20 $ + * last change: $Author: tl $ $Date: 2001-07-23 08:56:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,9 @@ #ifndef _TOOLS_DEBUG_HXX //autogen #include #endif +#ifndef _SVX_SUBSETMAP_HXX +#include +#endif #ifndef CONFIG_HXX @@ -1695,6 +1698,22 @@ IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, pListBox ) } +IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, pListBox ) +{ + USHORT nPos = aFontsSubsetLB.GetSelectEntryPos(); + if (LISTBOX_ENTRY_NOTFOUND != nPos) + { + const Subset* pSubset = reinterpret_cast (aFontsSubsetLB.GetEntryData( nPos )); + if (pSubset) + { + sal_Unicode cFirst = pSubset->GetRangeMin(); + aCharsetDisplay.SelectCharacter( cFirst ); + } + } + return 0; +} + + IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) { DBG_ASSERT(pComboBox == &aStyles, "Sm : falsches Argument"); @@ -1707,11 +1726,15 @@ IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) { sal_Unicode cChar = aCharsetDisplay.GetSelectCharacter(); -/* - const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); - if (pSubset) - aFontsSubsetLB.SelectEntry( pSubset->GetName() ); -*/ + + DBG_ASSERT( pSubsetMap, "SubsetMap missing" ) + if (pSubsetMap) + { + const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); + if (pSubset) + aFontsSubsetLB.SelectEntry( pSubset->GetName() ); + } + aSymbolDisplay.SetChar( cChar ); UpdateButtons(); return 0; @@ -1914,6 +1937,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO aCancelBtn (this, ResId(1)), aRightArrow (this, ResId(1)), pFontList (NULL), + pSubsetMap (NULL), rSymSetMgr (rMgr) { if (bFreeRes) @@ -1954,6 +1978,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO aOldSymbols .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); aStyles .SetModifyHdl(LINK(this, SmSymDefineDialog, ModifyHdl)); aFonts .SetSelectHdl(LINK(this, SmSymDefineDialog, FontChangeHdl)); + aFontsSubsetLB .SetSelectHdl(LINK(this, SmSymDefineDialog, SubsetChangeHdl)); aStyles .SetSelectHdl(LINK(this, SmSymDefineDialog, StyleChangeHdl)); aAddBtn .SetClickHdl (LINK(this, SmSymDefineDialog, AddClickHdl)); aChangeBtn .SetClickHdl (LINK(this, SmSymDefineDialog, ChangeClickHdl)); @@ -1965,6 +1990,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO SmSymDefineDialog::~SmSymDefineDialog() { delete pFontList; + delete pSubsetMap; } @@ -2168,6 +2194,30 @@ void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rSt aCharsetDisplay.SetFont(aFI); aSymbolDisplay.SetFont(aFI); + + // update subset listbox for new font's unicode subsets + FontCharMap aFontCharMap; + aCharsetDisplay.GetFontCharMap( aFontCharMap ); + if (pSubsetMap) + delete pSubsetMap; + pSubsetMap = new SubsetMap( &aFontCharMap ); + // + aFontsSubsetLB.Clear(); + if (pSubsetMap->GetSubsetCount() > 0) + { + const Subset* pSubset = 0; + for (USHORT i = 0; 0 != (pSubset = pSubsetMap->GetSubsetByIndex(i)); ++i) + { + USHORT nPos = aFontsSubsetLB.InsertEntry( pSubset->GetName()); + aFontsSubsetLB.SetEntryData( nPos, (void *) pSubset ); + // subset must live at least as long as the selected font !!! + } + aFontsSubsetLB.SelectEntryPos( 0 ); + BOOL bEnable = aFontsSubsetLB.GetEntryCount() > 1; + if (!bEnable) + aFontsSubsetLB.SetNoSelection(); + aFontsSubsetLB.Enable( bEnable ); + } } -- cgit v1.2.3 From 165b30aac0a39424221132ef1c521fb564c7ce5d Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 30 Jul 2001 09:51:29 +0000 Subject: #89759# font subset box cleared if the selected character has no subset --- starmath/source/dialog.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b651012472af..83cb1a0cc9b1 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: tl $ $Date: 2001-07-23 08:56:32 $ + * last change: $Author: tl $ $Date: 2001-07-30 10:51:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1733,6 +1733,8 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); if (pSubset) aFontsSubsetLB.SelectEntry( pSubset->GetName() ); + else + aFontsSubsetLB.SetNoSelection(); } aSymbolDisplay.SetChar( cChar ); -- cgit v1.2.3 From 46bb8e548537a69dfbfcb5d80587338a9da92d72 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 9 Aug 2001 11:24:29 +0000 Subject: #90802# localization of 'Typeface' listbox entries in SmSymDefineDialog --- starmath/source/dialog.cxx | 96 +++++++++++++++++++++++++++++++--------- starmath/source/smres.src | 104 ++++++++++++++++++++++---------------------- starmath/source/utility.cxx | 11 ++++- 3 files changed, 136 insertions(+), 75 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 83cb1a0cc9b1..ca1c4e7b8dca 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: tl $ $Date: 2001-07-30 10:51:29 $ + * last change: $Author: tl $ $Date: 2001-08-09 12:24:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,27 +144,77 @@ // Da der FontStyle besser über die Attribute gesetzt/abgefragt wird als über // den StyleName bauen wir uns hier unsere eigene Übersetzung // Attribute <-> StyleName -// Die Bits des Index stellen die Attribute dar: -// Bit 0 : italic -// Bit 1 : bold // -static XubString __READONLY_DATA aStyleName[4] = +class SmFontStyles { - C2S("normal"), C2S("italic"), - C2S("bold"), C2S("bold italic") + String aNormal; + String aBold; + String aItalic; + String aBoldItalic; + String aEmpty; + +public: + SmFontStyles(); + + USHORT GetCount() const { return 4; } + const String & GetStyleName( const Font &rFont ) const; + const String & GetStyleName( USHORT nIdx ) const; }; -USHORT aStyleNameCount = sizeof(aStyleName) / sizeof(aStyleName[0]); + +SmFontStyles::SmFontStyles() : + aNormal ( ResId( RID_FONTREGULAR, SM_MOD()->GetResMgr() ) ), + aBold ( ResId( RID_FONTBOLD, SM_MOD()->GetResMgr() ) ), + aItalic ( ResId( RID_FONTITALIC, SM_MOD()->GetResMgr() ) ) +{ +// SM_MOD()->GetResMgr().FreeResource(); + + aBoldItalic = aBold; + aBoldItalic.AppendAscii( ", " ); + aBoldItalic += aItalic; +} + + +const String & SmFontStyles::GetStyleName( const Font &rFont ) const +{ + BOOL bBold = rFont.GetWeight() == WEIGHT_BOLD, + bItalic = rFont.GetItalic() == ITALIC_NORMAL; + if (bBold && bItalic) + return aBoldItalic; + else if (bItalic) + return aItalic; + else if (bBold) + return aBold; + else + return aNormal; +} + + +const String & SmFontStyles::GetStyleName( USHORT nIdx ) const +{ + // 0 = "normal", 1 = "italic", + // 2 = "bold", 3 = "bold italic" + + DBG_ASSERT( nIdx < GetCount(), "index out of range" ); + switch (nIdx) + { + case 0 : return aNormal; + case 1 : return aItalic; + case 2 : return aBold; + case 3 : return aBoldItalic; + } + return aEmpty; +} -const XubString GetFontStyleName(const Font &rFont) +const SmFontStyles & GetFontStyles() { - USHORT nIndex = 2 * (rFont.GetWeight() == WEIGHT_BOLD) - + 1 * (rFont.GetItalic() == ITALIC_NORMAL); - return aStyleName[nIndex]; + static const SmFontStyles aImpl; + return aImpl; } +///////////////////////////////////////////////////////////////// void SetFontStyle(const XubString &rStyleName, Font &rFont) { @@ -174,10 +224,11 @@ void SetFontStyle(const XubString &rStyleName, Font &rFont) if (rStyleName.Len()) { USHORT i; - for (i = 0; i < aStyleNameCount; i++) - if (rStyleName.CompareTo(aStyleName[i]) == COMPARE_EQUAL) + const SmFontStyles &rStyles = GetFontStyles(); + for (i = 0; i < rStyles.GetCount(); i++) + if (rStyleName.CompareTo( rStyles.GetStyleName(i) ) == COMPARE_EQUAL) break; - DBG_ASSERT(i < aStyleNameCount, "Sm : StyleName unbekannt"); + DBG_ASSERT(i < rStyles.GetCount(), "style-name unknown"); nIndex = i; } @@ -1614,8 +1665,9 @@ void SmSymDefineDialog::FillStyles(BOOL bDeleteText) { //aStyles.Fill(aText, &aFontList); // eigene StyleName's verwenden - for (USHORT i = 0; i < aStyleNameCount; i++) - aStyles.InsertEntry( aStyleName[i] ); + const SmFontStyles &rStyles = GetFontStyles(); + for (USHORT i = 0; i < rStyles.GetCount(); i++) + aStyles.InsertEntry( rStyles.GetStyleName(i) ); DBG_ASSERT(aStyles.GetEntryCount() > 0, "Sm : keine Styles vorhanden"); aStyles.SetText( aStyles.GetEntry(0) ); @@ -1886,8 +1938,10 @@ void SmSymDefineDialog::UpdateButtons() bEqual = pOrigSymbol && aSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) && aSymbolName.Equals(pOrigSymbol->GetName()) - && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii(pOrigSymbol->GetFace().GetName()) - && aStyles.GetText().EqualsIgnoreCaseAscii(GetFontStyleName(pOrigSymbol->GetFace())) + && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii( + pOrigSymbol->GetFace().GetName()) + && aStyles.GetText().EqualsIgnoreCaseAscii( + GetFontStyles().GetStyleName(pOrigSymbol->GetFace())) && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); // hinzufügen nur wenn es noch kein Symbol desgleichen Namens gibt @@ -2147,7 +2201,7 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, // Font und Style entsprechend wählen const Font &rFont = pSymbol->GetFace(); SelectFont(rFont.GetName(), FALSE); - SelectStyle(GetFontStyleName(rFont), FALSE); + SelectStyle(GetFontStyles().GetStyleName(rFont), FALSE); // da das setzen des Fonts über den Style Namen des SymbolsFonts nicht // so gut klappt (er kann zB leer sein obwohl der Font selbst 'bold' und diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 1c30bbbf6ba6..bea8a233311b 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -2,9 +2,9 @@ * * $RCSfile: smres.src,v $ * - * $Revision: 1.43 $ + * $Revision: 1.44 $ * - * last change: $Author: rt $ $Date: 2001-08-08 10:13:58 $ + * last change: $Author: tl $ $Date: 2001-08-09 12:24:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3515,84 +3515,84 @@ QueryBox RID_DEFAULTSAVEQUERY String RID_FONTREGULAR { - Text = ", Normal" ; + Text = "Normal" ; Text [ ENGLISH ] = "Standard" ; Text [ norwegian ] = "Standard" ; Text [ italian ] = "Standard" ; Text [ portuguese_brazilian ] = "Padr?o" ; - Text [ portuguese ] = ", Padrão" ; - Text [ finnish ] = ", Vakio" ; - Text [ danish ] = ", Normal" ; + Text [ portuguese ] = "Padrão" ; + Text [ finnish ] = "Vakio" ; + Text [ danish ] = "Normal" ; Text [ french ] = "Par défaut" ; - Text [ swedish ] = ", Normal" ; - Text [ dutch ] = ", Normaal" ; - Text [ spanish ] = ", Predeterminado" ; - Text [ english_us ] = ", Standard" ; - Text[ chinese_simplified ] = ", 普通"; - Text[ russian ] = ", Îáû÷íûé"; - Text[ polish ] = ", Domyœlnie"; - Text[ japanese ] = ",通常"; + Text [ swedish ] = "Normal" ; + Text [ dutch ] = "Normaal" ; + Text [ spanish ] = "Predeterminado" ; + Text [ english_us ] = "Standard" ; + Text[ chinese_simplified ] = "普通"; + Text[ russian ] = "Îáû÷íûé"; + Text[ polish ] = "Domyœlnie"; + Text[ japanese ] = "通常"; Text[ chinese_traditional ] = ",普通"; - Text[ arabic ] = "ÚÇÏí ,"; - Text[ greek ] = ", ÊáíïíéêÜ"; - Text[ korean ] = ", 보통"; - Text[ turkish ] = ", standart"; + Text[ arabic ] = "ÚÇÏí"; + Text[ greek ] = "ÊáíïíéêÜ"; + Text[ korean ] = "보통"; + Text[ turkish ] = "standart"; Text[ language_user1 ] = " "; - Text[ catalan ] = ", Estándar"; + Text[ catalan ] = "Estándar"; }; String RID_FONTITALIC { - Text = ", Kursiv" ; + Text = "Kursiv" ; Text [ ENGLISH ] = "Italic" ; Text [ norwegian ] = "Kursiv" ; - Text [ italian ] = ", Corsivo" ; + Text [ italian ] = "Corsivo" ; Text [ portuguese_brazilian ] = "It?lico" ; - Text [ portuguese ] = ", Itálico" ; - Text [ finnish ] = ", Kursivoi" ; - Text [ danish ] = ", Kursiv" ; + Text [ portuguese ] = "Itálico" ; + Text [ finnish ] = "Kursivoi" ; + Text [ danish ] = "Kursiv" ; Text [ french ] = "Italique" ; - Text [ swedish ] = ", Kursiv" ; - Text [ dutch ] = ", Cursief" ; - Text [ spanish ] = ", Cursiva" ; - Text [ english_us ] = ", Italic" ; - Text[ chinese_simplified ] = ", 斜体"; - Text[ russian ] = ", Íàêëîííûé"; + Text [ swedish ] = "Kursiv" ; + Text [ dutch ] = "Cursief" ; + Text [ spanish ] = "Cursiva" ; + Text [ english_us ] = "Italic" ; + Text[ chinese_simplified ] = "斜体"; + Text[ russian ] = "Íàêëîííûé"; Text[ polish ] = "Kursywa"; - Text[ japanese ] = ",斜体"; - Text[ chinese_traditional ] = ", 斜體"; + Text[ japanese ] = "斜体"; + Text[ chinese_traditional ] = "斜體"; Text[ arabic ] = "ãÇÆá"; - Text[ greek ] = ", ÐëÜãéá"; + Text[ greek ] = "ÐëÜãéá"; Text[ korean ] = "ì´íƒ¤ë¦­ì²´"; - Text[ turkish ] = ", italik"; + Text[ turkish ] = "italik"; Text[ language_user1 ] = " "; - Text[ catalan ] = ", Cursiva"; + Text[ catalan ] = "Cursiva"; }; String RID_FONTBOLD { - Text = ", Fett" ; + Text = "Fett" ; Text [ ENGLISH ] = "Bold" ; Text [ norwegian ] = "Fet" ; Text [ italian ] = "Grassetto" ; Text [ portuguese_brazilian ] = "Negrito" ; - Text [ portuguese ] = ", Negrito" ; - Text [ finnish ] = ", Lihavoi" ; - Text [ danish ] = ", Fed" ; + Text [ portuguese ] = "Negrito" ; + Text [ finnish ] = "Lihavoi" ; + Text [ danish ] = "Fed" ; Text [ french ] = "Gras" ; - Text [ swedish ] = ", Fett" ; - Text [ dutch ] = ", Vet" ; - Text [ spanish ] = ", Negrita" ; - Text [ english_us ] = ", Bold" ; - Text[ chinese_simplified ] = ", 粗体"; - Text[ russian ] = ", Æèðíûé"; - Text[ polish ] = ", Pogrubienie"; - Text[ japanese ] = ",太字"; - Text[ chinese_traditional ] = ", ç²—é«”"; + Text [ swedish ] = "Fett" ; + Text [ dutch ] = "Vet" ; + Text [ spanish ] = "Negrita" ; + Text [ english_us ] = "Bold" ; + Text[ chinese_simplified ] = "粗体"; + Text[ russian ] = "Æèðíûé"; + Text[ polish ] = "Pogrubienie"; + Text[ japanese ] = "太字"; + Text[ chinese_traditional ] = "ç²—é«”"; Text[ arabic ] = "ÚÑíÖ"; - Text[ greek ] = ";¸íôïíï"; - Text[ korean ] = ", 굵게"; - Text[ turkish ] = ", kalýn"; + Text[ greek ] = "¸íôïíï"; + Text[ korean ] = "굵게"; + Text[ turkish ] = "kalýn"; Text[ language_user1 ] = " "; - Text[ catalan ] = ", Negrita"; + Text[ catalan ] = "Negrita"; }; String RID_APPLICATION { diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 42040db6dbab..1a58e3d4a88e 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -2,9 +2,9 @@ * * $RCSfile: utility.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tl $ $Date: 2001-08-08 11:22:18 $ + * last change: $Author: tl $ $Date: 2001-08-09 12:24:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -556,15 +556,22 @@ String SmFontPickList::GetStringItem(void *pItem) { Font *pFont; String aString; + const sal_Char *pDelim = ", "; pFont = (Font *)pItem; aString = pFont->GetName(); if (pFont->GetItalic() != ITALIC_NONE) + { + aString.AppendAscii( pDelim ); aString += String(SmResId(RID_FONTITALIC)); + } if (pFont->GetWeight() == WEIGHT_BOLD) + { + aString.AppendAscii( pDelim ); aString += String(SmResId(RID_FONTBOLD)); + } return (aString); } -- cgit v1.2.3 From f052415fb157f9f5ac6b8f9781cbcf2c66e1a56b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 16 Aug 2001 08:20:48 +0000 Subject: #90662# new default-fonts --- starmath/inc/format.hxx | 14 +++-- starmath/source/cfgitem.cxx | 144 +++++++++++++++++++------------------------- starmath/source/dialog.cxx | 9 +-- starmath/source/format.cxx | 105 +++++++++++++++++++++++++++++--- 4 files changed, 171 insertions(+), 101 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index d9dec1a9aa16..85dac8a4c52b 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -2,9 +2,9 @@ * * $RCSfile: format.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tl $ $Date: 2001-07-17 08:28:19 $ + * last change: $Author: tl $ $Date: 2001-08-16 09:19:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -145,9 +145,12 @@ enum SmHorAlign { AlignLeft, AlignCenter, AlignRight }; +String GetDefaultFontName( LanguageType nLang, USHORT nIdent ); + class SmFormat : public SfxBroadcaster { SmFace vFont[FNT_END + 1]; + BOOL bDefaultFont[FNT_END + 1]; Size aBaseSize; long nVersion; USHORT vSize[SIZ_END + 1]; @@ -164,8 +167,11 @@ public: void SetBaseSize(const Size &rSize) { aBaseSize = rSize; } const SmFace & GetFont(USHORT nIdent) const { return vFont[nIdent]; } - SmFace & Font (USHORT nIdent) { return vFont[nIdent]; } - void SetFont(USHORT nIdent, const SmFace &rFont); + void SetFont(USHORT nIdent, const SmFace &rFont, BOOL bDefault = FALSE); + void SetFontSize(USHORT nIdent, const Size &rSize) { vFont[nIdent].SetSize( rSize ); } + + void SetDefaultFont(USHORT nIdent, BOOL bVal) { bDefaultFont[nIdent] = bVal; } + BOOL IsDefaultFont(USHORT nIdent) const { return bDefaultFont[nIdent]; } USHORT GetRelSize(USHORT nIdent) const { return vSize[nIdent]; } void SetRelSize(USHORT nIdent, USHORT nVal) { vSize[nIdent] = nVal;} diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index a0b1c7baca22..d3014bd5ddf8 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgitem.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tl $ $Date: 2001-08-08 11:22:18 $ + * last change: $Author: tl $ $Date: 2001-08-16 09:20:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,10 @@ #pragma hdrstop +#ifndef _SV_SVAPP_HXX +#include +#endif + #include "cfgitem.hxx" #include "starmath.hrc" @@ -818,7 +822,6 @@ void SmMathConfig::SaveFontFormatList() SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ) ); Sequence< OUString > aNames = lcl_GetFontPropertyNames(); - const OUString *pNames = aNames.getConstArray(); INT32 nSymbolProps = aNames.getLength(); USHORT nCount = rFntFmtList.GetCount(); @@ -838,7 +841,7 @@ void SmMathConfig::SaveFontFormatList() aNodeNameDelim += aFntFmtId; aNodeNameDelim += aDelim; - const OUString *pName = pNames; + const OUString *pName = aNames.getConstArray();; // Name pVal->Name = aNodeNameDelim; @@ -992,56 +995,36 @@ void SmMathConfig::SaveOther() SmMathConfigItem aCfg( String::CreateFromAscii( aRootName )); - Sequence< OUString > aNames( aCfg.GetOtherPropertyNames() ); - const OUString *pNames = aNames.getConstArray(); - const OUString *pName = pNames; + const Sequence< OUString > aNames( aCfg.GetOtherPropertyNames() ); INT32 nProps = aNames.getLength(); - Sequence< PropertyValue > aValues( nProps ); - PropertyValue *pValues = aValues.getArray(); - PropertyValue *pVal = pValues; + Sequence< Any > aValues( nProps ); + Any *pValues = aValues.getArray(); + Any *pValue = pValues; // Print/Title - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bPrintTitle; - pVal++; + *pValue++ <<= (BOOL) pOther->bPrintTitle; // Print/FormulaText - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bPrintFormulaText; - pVal++; + *pValue++ <<= (BOOL) pOther->bPrintFormulaText; // Print/Frame - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bPrintFrame; - pVal++; + *pValue++ <<= (BOOL) pOther->bPrintFrame; // Print/Size - pVal->Name = *pNames++; - pVal->Value <<= (INT16) pOther->ePrintSize; - pVal++; + *pValue++ <<= (INT16) pOther->ePrintSize; // Print/ZoomFactor - pVal->Name = *pNames++; - pVal->Value <<= (INT16) pOther->nPrintZoomFactor; - pVal++; + *pValue++ <<= (INT16) pOther->nPrintZoomFactor; // Misc/NoSymbolsWarning - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bNoSymbolsWarning; - pVal++; + *pValue++ <<= (BOOL) pOther->bNoSymbolsWarning; // Misc/IgnoreSpacesRight - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bIgnoreSpacesRight; - pVal++; + *pValue++ <<= (BOOL) pOther->bIgnoreSpacesRight; // View/ToolboxVisible - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bToolboxVisible; - pVal++; + *pValue++ <<= (BOOL) pOther->bToolboxVisible; // View/AutoRedraw - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bAutoRedraw; - pVal++; + *pValue++ <<= (BOOL) pOther->bAutoRedraw; // View/FormulaCursor - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pOther->bFormulaCursor; - pVal++; - DBG_ASSERT( pVal - pValues == nProps, "property mismatch" ); + *pValue++ <<= (BOOL) pOther->bFormulaCursor; + + DBG_ASSERT( pValue - pValues == nProps, "property mismatch" ); + aCfg.PutProperties( aNames , aValues ); SetOtherModified( FALSE ); } @@ -1098,21 +1081,31 @@ void SmMathConfig::LoadFormat() ++pVal; } + LanguageType nLang = Application::GetSettings().GetUILanguage(); for (i = FNT_BEGIN; i < FNT_END; ++i) { Font aFnt; - + BOOL bUseDefaultFont = TRUE; if (pVal->hasValue() && (*pVal >>= aTmpStr)) { - const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr ); - DBG_ASSERT( pFntFmt, "unknown FontFormat" ); - if (pFntFmt) - aFnt = pFntFmt->GetFont(); + bUseDefaultFont = 0 == aTmpStr.getLength(); + if (bUseDefaultFont) + { + aFnt = pFormat->GetFont( i ); + aFnt.SetName( GetDefaultFontName( nLang, i ) ); + } + else + { + const SmFontFormat *pFntFmt = GetFontFormatList().GetFontFormat( aTmpStr ); + DBG_ASSERT( pFntFmt, "unknown FontFormat" ); + if (pFntFmt) + aFnt = pFntFmt->GetFont(); + } } ++pVal; aFnt.SetSize( pFormat->GetBaseSize() ); - pFormat->SetFont( i, aFnt ); + pFormat->SetFont( i, aFnt, bUseDefaultFont ); } DBG_ASSERT( pVal - pValues == nProps, "property mismatch" ); @@ -1128,59 +1121,46 @@ void SmMathConfig::SaveFormat() SmMathConfigItem aCfg( String::CreateFromAscii( aRootName )); - Sequence< OUString > aNames( aCfg.GetFormatPropertyNames() ); - const OUString *pNames = aNames.getConstArray(); - const OUString *pName = pNames; + const Sequence< OUString > aNames( aCfg.GetFormatPropertyNames() ); INT32 nProps = aNames.getLength(); - Sequence< PropertyValue > aValues( nProps ); - PropertyValue *pValues = aValues.getArray(); - PropertyValue *pVal = pValues; + Sequence< Any > aValues( nProps ); + Any *pValues = aValues.getArray(); + Any *pValue = pValues; // StandardFormat/Textmode - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pFormat->IsTextmode(); - pVal++; + *pValue++ <<= (BOOL) pFormat->IsTextmode(); // StandardFormat/ScaleNormalBracket - pVal->Name = *pNames++; - pVal->Value <<= (BOOL) pFormat->IsScaleNormalBrackets(); - pVal++; + *pValue++ <<= (BOOL) pFormat->IsScaleNormalBrackets(); // StandardFormat/HorizontalAlignment - pVal->Name = *pNames++; - pVal->Value <<= (INT16) pFormat->GetHorAlign(); - pVal++; + *pValue++ <<= (INT16) pFormat->GetHorAlign(); // StandardFormat/BaseSize - pVal->Name = *pNames++; - pVal->Value <<= (INT16) SmRoundFraction( Sm100th_mmToPts( + *pValue++ <<= (INT16) SmRoundFraction( Sm100th_mmToPts( pFormat->GetBaseSize().Height() ) ); - pVal++; USHORT i; for (i = SIZ_BEGIN; i <= SIZ_END; ++i) - { - pVal->Name = *pNames++; - pVal->Value <<= (INT16) pFormat->GetRelSize( i ); - ++pVal; - } + *pValue++ <<= (INT16) pFormat->GetRelSize( i ); for (i = DIS_BEGIN; i <= DIS_END; ++i) - { - pVal->Name = *pNames++; - pVal->Value <<= (INT16) pFormat->GetDistance( i ); - ++pVal; - } + *pValue++ <<= (INT16) pFormat->GetDistance( i ); for (i = FNT_BEGIN; i < FNT_END; ++i) { - SmFontFormat aFntFmt( pFormat->GetFont( i ) ); - String aFntFmtId( GetFontFormatList().GetFontFormatId( aFntFmt ) ); - DBG_ASSERT( aFntFmtId.Len(), "FontFormatId not found" ); + OUString aFntFmtId; - pVal->Name = *pNames++; - pVal->Value <<= OUString( aFntFmtId ); - ++pVal; + if (!pFormat->IsDefaultFont( i )) + { + SmFontFormat aFntFmt( pFormat->GetFont( i ) ); + aFntFmtId = GetFontFormatList().GetFontFormatId( aFntFmt, TRUE ); + DBG_ASSERT( aFntFmtId.getLength(), "FontFormatId not found" ); + } + + *pValue++ <<= aFntFmtId; } - DBG_ASSERT( pVal - pValues == nProps, "property mismatch" ); + + DBG_ASSERT( pValue - pValues == nProps, "property mismatch" ); + aCfg.PutProperties( aNames , aValues ); SetFormatModified( FALSE ); } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index ca1c4e7b8dca..f23ea9ade336 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: tl $ $Date: 2001-08-09 12:24:29 $ + * last change: $Author: tl $ $Date: 2001-08-16 09:20:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -538,7 +538,7 @@ void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const const Size aTmp (rFormat.GetBaseSize()); for (USHORT i = FNT_BEGIN; i <= FNT_END; i++) - rFormat.Font(i).SetSize(aTmp); + rFormat.SetFontSize(i, aTmp); rFormat.RequestApplyChanges(); } @@ -666,9 +666,6 @@ void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const rFormat.SetFont( FNT_SANS, aSansFont .Get(0) ); rFormat.SetFont( FNT_FIXED, aFixedFont .Get(0) ); - for (USHORT i = FNT_BEGIN; i <= FNT_FIXED; i++) - rFormat.Font(i).SetTransparent(TRUE); - rFormat.RequestApplyChanges(); } diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx index fb34f69d10e0..3b4cb2af4ca4 100644 --- a/starmath/source/format.cxx +++ b/starmath/source/format.cxx @@ -2,9 +2,9 @@ * * $RCSfile: format.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: tl $ $Date: 2001-08-08 11:22:18 $ + * last change: $Author: tl $ $Date: 2001-08-16 09:20:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,11 +64,90 @@ #ifndef _STREAM_HXX #include #endif +#ifndef _SV_SVAPP_HXX +#include +#endif +#ifndef _SVX_SCRIPTTYPEITEM_HXX +#include +#endif #ifndef FORMAT_HXX #include "format.hxx" #endif +///////////////////////////////////////////////////////////////// + +// Latin default-fonts +static const USHORT aLatinDefFnts[FNT_END] = +{ + DEFAULTFONT_SERIF, // FNT_VARIABLE + DEFAULTFONT_SERIF, // FNT_FUNCTION + DEFAULTFONT_SERIF, // FNT_NUMBER + DEFAULTFONT_SERIF, // FNT_TEXT + DEFAULTFONT_SERIF, // FNT_SERIF + DEFAULTFONT_SANS, // FNT_SANS + DEFAULTFONT_FIXED // FNT_FIXED + //StarSymbol, // FNT_MATH +}; + +// CJK default-fonts +//! we use non-asian fonts for variables, functions and numbers since they +//! look better and even in asia only latin letters will be used for those. +//! At least that's what I was told... +static const USHORT aCJKDefFnts[FNT_END] = +{ + DEFAULTFONT_SERIF, // FNT_VARIABLE + DEFAULTFONT_SERIF, // FNT_FUNCTION + DEFAULTFONT_SERIF, // FNT_NUMBER + DEFAULTFONT_CJK_TEXT, // FNT_TEXT + DEFAULTFONT_CJK_TEXT, // FNT_SERIF + DEFAULTFONT_CJK_DISPLAY, // FNT_SANS + DEFAULTFONT_CJK_TEXT // FNT_FIXED + //StarSymbol, // FNT_MATH +}; + +// CTL default-fonts +static const USHORT aCTLDefFnts[FNT_END] = +{ + DEFAULTFONT_CTL_TEXT, // FNT_VARIABLE + DEFAULTFONT_CTL_TEXT, // FNT_FUNCTION + DEFAULTFONT_CTL_TEXT, // FNT_NUMBER + DEFAULTFONT_CTL_TEXT, // FNT_TEXT + DEFAULTFONT_CTL_TEXT, // FNT_SERIF + DEFAULTFONT_CTL_TEXT, // FNT_SANS + DEFAULTFONT_CTL_TEXT // FNT_FIXED + //StarSymbol, // FNT_MATH +}; + + +String GetDefaultFontName( LanguageType nLang, USHORT nIdent ) +{ + DBG_ASSERT( FNT_BEGIN <= nIdent && nIdent <= FNT_END, + "index out opd range" ); + + if (FNT_MATH == nIdent) + return String::CreateFromAscii( FNTNAME_MATH ); + else + { + const USHORT *pTable; + switch (GetScriptTypeOfLanguage( nLang )) + { + case SCRIPTTYPE_LATIN : pTable = aLatinDefFnts; break; + case SCRIPTTYPE_ASIAN : pTable = aCJKDefFnts; break; + case SCRIPTTYPE_COMPLEX : pTable = aCTLDefFnts; break; + default : + pTable = aLatinDefFnts; + DBG_ERROR( "unknown script-type" ); + } + + return Application::GetDefaultDevice()->GetDefaultFont( + pTable[ nIdent ], nLang, + DEFAULTFONT_FLAGS_ONLYONE ).GetName(); + } +} + +///////////////////////////////////////////////////////////////// + SmFormat::SmFormat() : aBaseSize(0, SmPtsTo100th_mm(12)) { @@ -127,15 +206,18 @@ SmFormat::SmFormat() { vFont[i].SetTransparent(TRUE); vFont[i].SetAlign(ALIGN_BASELINE); + bDefaultFont[i] = FALSE; } } -void SmFormat::SetFont(USHORT nIdent, const SmFace &rFont) +void SmFormat::SetFont(USHORT nIdent, const SmFace &rFont, BOOL bDefault ) { vFont[nIdent] = rFont; vFont[nIdent].SetTransparent( TRUE ); vFont[nIdent].SetAlign( ALIGN_BASELINE ); + + bDefaultFont[nIdent] = bDefault; } SmFormat & SmFormat::operator = (const SmFormat &rFormat) @@ -148,7 +230,10 @@ SmFormat & SmFormat::operator = (const SmFormat &rFormat) USHORT i; for (i = FNT_BEGIN; i <= FNT_END; i++) + { SetFont(i, rFormat.GetFont(i)); + SetDefaultFont(i, rFormat.IsDefaultFont(i)); + } for (i = SIZ_BEGIN; i <= SIZ_END; i++) SetRelSize(i, rFormat.GetRelSize(i)); for (i = DIS_BEGIN; i <= DIS_END; i++) @@ -178,7 +263,8 @@ BOOL SmFormat::operator == (const SmFormat &rFormat) const } for (i = 0; i <= FNT_END && bRes; ++i) { - if (vFont[i] != rFormat.vFont[i]) + if (vFont[i] != rFormat.vFont[i] || + bDefaultFont[i] != rFormat.bDefaultFont[i]) bRes = FALSE; } @@ -317,7 +403,7 @@ void SmFormat::ReadSM20Format(SvStream &rStream) rStream >> n; for (i = FNT_BEGIN; i <= FNT_FIXED; i++) - ReadSM20Font(rStream, Font(i)); + ReadSM20Font(rStream, vFont[i]); for (i = DIS_BEGIN; i <= DIS_OPERATORSPACE; i++) { rStream >> n; @@ -331,11 +417,12 @@ void SmFormat::ReadSM20Format(SvStream &rStream) const Size aTmp (GetBaseSize()); for (i = FNT_BEGIN; i <= FNT_FIXED; i++) { - Font(i).SetSize(aTmp); - Font(i).SetTransparent(TRUE); - Font(i).SetAlign(ALIGN_BASELINE); + SmFace &rFace = vFont[i]; + rFace.SetSize(aTmp); + rFace.SetTransparent(TRUE); + rFace.SetAlign(ALIGN_BASELINE); } - Font(FNT_MATH).SetSize(aTmp); + vFont[FNT_MATH].SetSize(aTmp); } -- cgit v1.2.3 From 33921ff9a613e5ca2aaab0dfea66e44e2cef95c7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 13 Sep 2001 10:16:08 +0000 Subject: problem with new SOLARIS compiler fixed --- starmath/inc/dialog.hxx | 8 ++++---- starmath/inc/symbol.hxx | 22 +++++++++++----------- starmath/source/dialog.cxx | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 50b57dbaf1eb..8c40a0643a24 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: tl $ $Date: 2001-07-23 08:54:36 $ + * last change: $Author: tl $ $Date: 2001-09-13 11:14:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -534,9 +534,9 @@ class SmSymDefineDialog : public ModalDialog BOOL SelectStyle(const XubString &rStyleName, BOOL bApplyFont); - SmSymSet *GetSymbolSet(const ComboBox &rComboBox); + SmSymSet *GetSymbolSet(const ComboBox &rComboBox); inline const SmSymSet *GetSymbolSet(const ComboBox &rComboBox) const; - SmSym *GetSymbol(const ComboBox &rComboBox); + SmSym *GetSymbol(const ComboBox &rComboBox); inline const SmSym *GetSymbol(const ComboBox &rComboBox) const; public: diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 0a466b29b147..2e4d50867ccc 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tl $ $Date: 2001-08-28 07:46:06 $ + * last change: $Author: tl $ $Date: 2001-09-13 11:15:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -257,27 +257,27 @@ public: void ChangeSymbolSet(SmSymSet* pSymbolSet); void DeleteSymbolSet(USHORT SymbolSetNo); USHORT GetSymbolSetPos(const String& rSymbolSetName) const; - USHORT GetSymbolSetCount() const { return pImpl->NoSymbolSets; } + USHORT GetSymbolSetCount() const { return pImpl->NoSymbolSets; } SmSymSet *GetSymbolSet(USHORT SymbolSetNo) const { return pImpl->SymbolSets.Get(SymbolSetNo); } - SmSym * GetSymbol(const String& rSymbolName); - const SmSym * GetSymbol(const String& rSymbolName) const + SmSym * GetSymbolByName(const String& rSymbolName); + const SmSym * GetSymbolByName(const String& rSymbolName) const { - return ((SmSymSetManager *) this)->GetSymbol(rSymbolName); + return ((SmSymSetManager *) this)->GetSymbolByName(rSymbolName); } - void AddReplaceSymbol( const SmSym & rSymbol ); - USHORT GetSymbolCount() const; - const SmSym * GetSymbol( USHORT nPos ) const; + void AddReplaceSymbol( const SmSym & rSymbol ); + USHORT GetSymbolCount() const; + const SmSym * GetSymbolByPos( USHORT nPos ) const; BOOL IsModified() const { return pImpl->Modified; } void SetModified(BOOL Modify) { pImpl->Modified = Modify; } - void Load(); - void Save(); + void Load(); + void Save(); }; #endif diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index f23ea9ade336..d300bc79bbfe 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: tl $ $Date: 2001-08-16 09:20:48 $ + * last change: $Author: tl $ $Date: 2001-09-13 11:16:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1689,7 +1689,7 @@ SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, "Sm : falsche ComboBox"); - return aSymSetMgrCopy.GetSymbol(rComboBox.GetText()); + return aSymSetMgrCopy.GetSymbolByName(rComboBox.GetText()); } @@ -1942,7 +1942,7 @@ void SmSymDefineDialog::UpdateButtons() && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); // hinzufügen nur wenn es noch kein Symbol desgleichen Namens gibt - bAdd = aSymSetMgrCopy.GetSymbol(aSymbolName) == NULL; + bAdd = aSymSetMgrCopy.GetSymbolByName(aSymbolName) == NULL; // löschen nur wenn alle Einstellungen gleich sind bDelete = pOrigSymbol != NULL; @@ -2224,7 +2224,7 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, XubString aOldSymbolSetName; if (nPos != COMBOBOX_ENTRY_NOTFOUND) { - pOldSymbol = aSymSetMgrCopy.GetSymbol(aNormName); + pOldSymbol = aSymSetMgrCopy.GetSymbolByName(aNormName); aOldSymbolSetName = aOldSymbolSets.GetText(); } SetOrigSymbol(pOldSymbol, aOldSymbolSetName); -- cgit v1.2.3 From d30e2d25d3e8a071e716059c6b47d1191b4b4a49 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 2 Oct 2001 11:58:49 +0000 Subject: #92656# GPF when changing the symbol-set fixed --- starmath/inc/symbol.hxx | 5 +++-- starmath/source/dialog.cxx | 32 ++++++++++++++++++++++++-------- starmath/source/symbol.cxx | 6 ++++-- 3 files changed, 31 insertions(+), 12 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 2e4d50867ccc..3248c59e1b06 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: tl $ $Date: 2001-09-13 11:15:07 $ + * last change: $Author: tl $ $Date: 2001-10-02 12:57:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -159,6 +159,7 @@ public: BOOL IsPredefined() const { return bPredefined; } const String & GetSetName() const { return aSetName; } + void SetSetName( const String &rName ) { aSetName = rName; } const String & GetExportName() const { return aExportName; } void SetExportName( const String &rName ) { aExportName = rName; } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index d300bc79bbfe..dca92aea98b4 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: tl $ $Date: 2001-09-13 11:16:08 $ + * last change: $Author: tl $ $Date: 2001-10-02 12:58:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1863,8 +1863,20 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) // das SymbolSet wechseln wenn nötig if (pOldSymSet != pNewSymSet) { + pNewSymSet->AddSymbol( new SmSym( *pSym ) ); pOldSymSet->DeleteSymbol(nSymbol); - pNewSymSet->AddSymbol(pSym); + + // + // update controls + // + // actualize symbol-lists in the dialog + String aOldSymbolName( pOrigSymbol->GetName() ); + aOldSymbols.SetText( String() ); + aOldSymbols.RemoveEntry( aOldSymbolName ); + if (aSymbolSets.GetText() == aOldSymbolSets.GetText()) + aSymbols.RemoveEntry( aOldSymbolName ); + // clear display for original symbol + SetOrigSymbol(NULL, XubString()); } //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, @@ -1894,8 +1906,6 @@ IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) USHORT nSymbolNo = pSymSet->GetSymbolPos(aOldSymbolName); DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol"); // Bezüge auf das Symbols löschen - DBG_ASSERT(pOrigSymbol == &pSymSet->GetSymbol(nSymbolNo), - "Sm : Fehler beim löschen des Symbols"); SetOrigSymbol(NULL, XubString()); // und weg mit dem Symbol pSymSet->DeleteSymbol(nSymbolNo); @@ -2044,6 +2054,7 @@ SmSymDefineDialog::~SmSymDefineDialog() { delete pFontList; delete pSubsetMap; + delete pOrigSymbol; } @@ -2148,12 +2159,17 @@ BOOL SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName) { - pOrigSymbol = pSymbol; + // clear old symbol + delete pOrigSymbol; + pOrigSymbol = 0; - XubString aSymName, - aSymSetName; + XubString aSymName, + aSymSetName; if (pSymbol) { + // set new symbol + pOrigSymbol = new SmSym( *pSymbol ); + aSymName = pSymbol->GetName(); aSymSetName = rSymbolSetName; aOldSymbolDisplay.SetFont(pSymbol->GetFace()); diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 9715266ab15f..95d10ad16ba8 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: tl $ $Date: 2001-09-13 11:21:41 $ + * last change: $Author: tl $ $Date: 2001-10-02 12:58:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -287,6 +287,8 @@ USHORT SmSymSet::AddSymbol(SmSym* pSymbol) { DBG_ASSERT(pSymbol, "Kein Symbol"); + if (pSymbol) + pSymbol->SetSetName( GetName() ); SymbolList.Insert(pSymbol, LIST_APPEND); DBG_ASSERT(SymbolList.GetPos(pSymbol) == SymbolList.Count() - 1, "Sm : ... ergibt falschen return Wert"); -- cgit v1.2.3 From 3ae1a093e1136a971b6a940dd691da5da92ee454 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 4 Oct 2001 11:25:13 +0000 Subject: #92654# loss of bold attribut in symbol-define-dialog fixed --- starmath/source/dialog.cxx | 16 ++++++++++------ starmath/source/node.cxx | 6 ++++-- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index dca92aea98b4..dff6d1b590b4 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: tl $ $Date: 2001-10-02 12:58:49 $ + * last change: $Author: tl $ $Date: 2001-10-04 12:25:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,8 +178,10 @@ SmFontStyles::SmFontStyles() : const String & SmFontStyles::GetStyleName( const Font &rFont ) const { - BOOL bBold = rFont.GetWeight() == WEIGHT_BOLD, - bItalic = rFont.GetItalic() == ITALIC_NORMAL; + //! compare also SmSpecialNode::Prepare + BOOL bBold = rFont.GetWeight() > WEIGHT_NORMAL, + bItalic = rFont.GetItalic() != ITALIC_NONE; + if (bBold && bItalic) return aBoldItalic; else if (bItalic) @@ -1855,9 +1857,11 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) SmSym *pSym = (SmSym *) &pOldSymSet->GetSymbol(nSymbol); DBG_ASSERT(pSym, "Sm : NULL pointer"); - // Änderungen durchführen; + // apply changes pSym->SetName( aSymbols.GetText() ); - pSym->SetFace( aCharsetDisplay.GetFont() ); + //! get font from symbol-display since charset-display does not keep + //! the bold attribut. + pSym->SetFace( aSymbolDisplay.GetFont() ); pSym->SetCharacter( aCharsetDisplay.GetSelectCharacter() ); // das SymbolSet wechseln wenn nötig diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 9948f90485ca..16edc48b5f27 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2,9 +2,9 @@ * * $RCSfile: node.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: tl $ $Date: 2001-09-13 11:21:27 $ + * last change: $Author: tl $ $Date: 2001-10-04 12:25:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2738,6 +2738,8 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell //! daher vergleichen wir hier mit > statt mit != . //! (Langfristig sollte die Notwendigkeit für 'PrepareAttribut', und damit //! für dieses hier, mal entfallen.) + // + //! see also SmFontStyles::GetStyleName if (GetFont().GetWeight() > WEIGHT_NORMAL) SetAttribut(ATTR_BOLD); if (GetFont().GetItalic() != ITALIC_NONE) -- cgit v1.2.3 From 3628db4881a1fed5b18832157cfd496ee3eab436 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 5 Oct 2001 08:05:48 +0000 Subject: #92654# symbol-dialog remembers selected position after closing of symbol-define-dialog --- starmath/inc/dialog.hxx | 7 ++++--- starmath/source/dialog.cxx | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 8c40a0643a24..191bd3c771f7 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tl $ $Date: 2001-09-13 11:14:38 $ + * last change: $Author: tl $ $Date: 2001-10-05 09:04:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -447,7 +447,8 @@ public: virtual ~SmSymbolDialog(); BOOL SelectSymbolSet(const XubString &rSymbolSetName); - void SelectSymbol(USHORT nSymbolNo); + void SelectSymbol(USHORT nSymbolPos); + USHORT GetSelectedSymbol() const { return aSymbolSetDisplay.GetSelectSymbol(); } }; //////////////////////////////////////////////////////////////////////////////// diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index dff6d1b590b4..5a4e74554179 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: tl $ $Date: 2001-10-04 12:25:13 $ + * last change: $Author: tl $ $Date: 2001-10-05 09:05:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1421,6 +1421,8 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) // altes SymbolSet merken XubString aOldSymbolSet (aSymbolSets.GetSelectEntry()); + USHORT nSymPos = GetSelectedSymbol(); + // Dialog an evtl geänderte Daten des SymbolSet Manager anpassen if (pDialog->Execute() == RET_OK && rSymSetMgr.IsModified()) FillSymbolSets(); @@ -1430,6 +1432,8 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) if (!SelectSymbolSet(aOldSymbolSet) && aSymbolSets.GetEntryCount() > 0) SelectSymbolSet(aSymbolSets.GetEntry(0)); + SelectSymbol( nSymPos ); + delete pDialog; return 0; } -- cgit v1.2.3 From 4d43e7aada947bbecb1ef70e0dcd14752081bed7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 24 Apr 2002 09:15:41 +0000 Subject: #98793#, #98794# HC compatibilty of font selection dialog, symbol dialog and symbol define dialog --- starmath/source/dialog.cxx | 166 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 148 insertions(+), 18 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 5a4e74554179..3bf47ef212b5 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: tl $ $Date: 2001-10-05 09:05:48 $ + * last change: $Author: tl $ $Date: 2002-04-24 10:15:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,6 +97,12 @@ #ifndef _SV_WAITOBJ_HXX #include #endif +#ifndef _SV_SETTINGS_HXX +#include +#endif +#ifndef _SV_WALL_HXX +#include +#endif #ifndef _SFXDISPATCH_HXX //autogen #include #endif @@ -347,8 +353,10 @@ SfxTabPage* SmPrintOptionsTabPage::Create(Window* pWindow, const SfxItemSet& rSe /**************************************************************************/ -void SmShowFont::Paint(const Rectangle&) +void SmShowFont::Paint(const Rectangle& rRect ) { + Control::Paint( rRect ); + XubString Text (GetFont().GetName()); Size TextSize(GetTextWidth(Text), GetTextHeight()); @@ -359,12 +367,16 @@ void SmShowFont::Paint(const Rectangle&) void SmShowFont::SetFont(const Font& rFont) { + Color aTxtColor( GetTextColor() ); Font aFont (rFont); Invalidate(); aFont.SetSize(Size(0, 24)); aFont.SetAlign(ALIGN_TOP); Control::SetFont(aFont); + + // keep old text color (new font may have different color) + SetTextColor( aTxtColor ); } @@ -456,9 +468,11 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) Face.SetCharSet(RTL_TEXTENCODING_DONTKNOW); Face.SetTransparent(TRUE); - Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); - aShowFont.SetBackground( aWhiteWall ); + InitColor_Impl(); + + // preview like controls should have a 2D look aShowFont.SetBorderStyle( WINDOW_BORDER_MONO ); + //Application::LeaveWait(); } @@ -468,6 +482,36 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) aItalicCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); } +void SmFontDialog::InitColor_Impl() +{ +#ifdef DEBUG + Color aBC( GetBackground().GetColor() ); +#endif + ColorData nBgCol = COL_WHITE, + nTxtCol = COL_BLACK; + if (GetBackground().GetColor().IsDark()) + { + const StyleSettings &rS = GetSettings().GetStyleSettings(); + nBgCol = rS.GetFieldColor().GetColor(); + nTxtCol = rS.GetFieldTextColor().GetColor(); + } + + Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Color aTxtColor( nTxtCol ); + aShowFont.SetBackground( aWall ); + aShowFont.SetTextColor( aTxtColor ); +} + + +void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt ) +{ + if ( rDCEvt.GetType() == DATACHANGED_SETTINGS && + (rDCEvt.GetFlags() & SETTINGS_STYLE) ) + InitColor_Impl(); + + ModalDialog::DataChanged( rDCEvt ); +} + /**************************************************************************/ @@ -978,6 +1022,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) if (bFreeRes) FreeResource(); + // preview like controls should have a 2D look aBitmap.SetBorderStyle( WINDOW_BORDER_MONO ); aMetricField1.SetGetFocusHdl(LINK(this, SmDistanceDialog, GetFocusHdl)); @@ -1160,6 +1205,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) int v = (int) (aVScrollBar.GetThumbPos() * nColumns); int nSymbols = (int) aSymbolSet.GetCount(); + Color aTxtColor( GetTextColor() ); for (int i = v; i < nSymbols ; i++) { SmSym aSymbol (aSymbolSet.GetSymbol(i)); @@ -1169,6 +1215,8 @@ void SmShowSymbolSet::Paint(const Rectangle&) // (hoffentlich auch genug für links und rechts!) aFont.SetSize(Size(0, nLen - (nLen / 3))); SetFont(aFont); + // keep text color + SetTextColor( aTxtColor ); int nIV = i - v; Size aSize(GetTextWidth(aSymbol.GetCharacter()), GetTextHeight()); @@ -1327,6 +1375,7 @@ void SmShowSymbolSet::SelectSymbol(USHORT nSymbol) Update(); } + IMPL_LINK( SmShowSymbolSet, ScrollHdl, ScrollBar*, pScrollBar) { Invalidate(); @@ -1335,8 +1384,10 @@ IMPL_LINK( SmShowSymbolSet, ScrollHdl, ScrollBar*, pScrollBar) //////////////////////////////////////////////////////////////////////////////// -void SmShowSymbol::Paint(const Rectangle&) +void SmShowSymbol::Paint(const Rectangle &rRect) { + Control::Paint( rRect ); + const XubString &rText = GetText(); Size aTextSize(GetTextWidth(rText), GetTextHeight()); @@ -1358,10 +1409,15 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) { if (pSymbol) { + Color aTxtColor( GetTextColor() ); + Font aFont (pSymbol->GetFace()); aFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); SetFont(aFont); + // keep old text color (font may have different color set) + SetTextColor(aTxtColor); + SetText(XubString(pSymbol->GetCharacter())); } @@ -1371,6 +1427,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) Invalidate(); } + //////////////////////////////////////////////////////////////////////////////// void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) @@ -1500,11 +1557,10 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre if (aSymbolSets.GetEntryCount() > 0) SelectSymbolSet(aSymbolSets.GetEntry(0)); - // set background color to white - Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); - aSymbolDisplay .SetBackground( aWhiteWall ); - aSymbolDisplay .SetBorderStyle( WINDOW_BORDER_MONO ); - aSymbolSetDisplay.SetBackground( aWhiteWall ); + InitColor_Impl(); + + // preview like controls should have a 2D look + aSymbolDisplay.SetBorderStyle( WINDOW_BORDER_MONO ); aSymbolSets .SetSelectHdl (LINK(this, SmSymbolDialog, SymbolSetChangeHdl)); aSymbolSetDisplay.SetSelectHdl (LINK(this, SmSymbolDialog, SymbolChangeHdl)); @@ -1522,6 +1578,39 @@ SmSymbolDialog::~SmSymbolDialog() } +void SmSymbolDialog::InitColor_Impl() +{ +#ifdef DEBUG + Color aBC( GetBackground().GetColor() ); +#endif + ColorData nBgCol = COL_WHITE, + nTxtCol = COL_BLACK; + if (GetBackground().GetColor().IsDark()) + { + const StyleSettings &rS = GetSettings().GetStyleSettings(); + nBgCol = rS.GetFieldColor().GetColor(); + nTxtCol = rS.GetFieldTextColor().GetColor(); + } + + Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Color aTxtColor( nTxtCol ); + aSymbolDisplay .SetBackground( aWall ); + aSymbolDisplay .SetTextColor( aTxtColor ); + aSymbolSetDisplay.SetBackground( aWall ); + aSymbolSetDisplay.SetTextColor( aTxtColor ); +} + + +void SmSymbolDialog::DataChanged( const DataChangedEvent& rDCEvt ) +{ + if ( rDCEvt.GetType() == DATACHANGED_SETTINGS && + (rDCEvt.GetFlags() & SETTINGS_STYLE) ) + InitColor_Impl(); + + ModalDialog::DataChanged( rDCEvt ); +} + + BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName) { BOOL bRet = FALSE; @@ -1570,10 +1659,11 @@ const SmSym * SmSymbolDialog::GetSymbol() const //////////////////////////////////////////////////////////////////////////////// -void SmShowChar::Paint(const Rectangle&) +void SmShowChar::Paint(const Rectangle &rRect) { - XubString Text (GetText ()); + Control::Paint( rRect ); + XubString Text (GetText ()); if (Text.Len() > 0) { Size aTextSize(GetTextWidth(Text), GetTextHeight()); @@ -1593,6 +1683,8 @@ void SmShowChar::SetChar(xub_Unicode aChar) void SmShowChar::SetFont(const Font &rFont) { + Color aTxtColor( GetTextColor() ); + Font aFont (rFont); Size aSize (Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); @@ -1600,6 +1692,9 @@ void SmShowChar::SetFont(const Font &rFont) aFont.SetTransparent(TRUE); Control::SetFont(aFont); + // keep text color (new font may have different one) + SetTextColor( aTxtColor ); + Invalidate(); } @@ -2033,11 +2128,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO if (aFonts.GetEntryCount() > 0) SelectFont(aFonts.GetEntry(0)); - // set background color to white - Wallpaper aWhiteWall( (Color) Color(COL_WHITE) ); - aCharsetDisplay .SetBackground( aWhiteWall ); - aOldSymbolDisplay.SetBackground( aWhiteWall ); - aOldSymbolDisplay.SetBackground( aWhiteWall ); + InitColor_Impl(); SetSymbolSetManager(rSymSetMgr); @@ -2055,6 +2146,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO aChangeBtn .SetClickHdl (LINK(this, SmSymDefineDialog, ChangeClickHdl)); aDeleteBtn .SetClickHdl (LINK(this, SmSymDefineDialog, DeleteClickHdl)); aCharsetDisplay.SetHighlightHdl( LINK( this, SmSymDefineDialog, CharHighlightHdl ) ); + + // preview like controls should have a 2D look + aOldSymbolDisplay.SetBorderStyle( WINDOW_BORDER_MONO ); + aSymbolDisplay .SetBorderStyle( WINDOW_BORDER_MONO ); } @@ -2066,6 +2161,41 @@ SmSymDefineDialog::~SmSymDefineDialog() } +void SmSymDefineDialog::InitColor_Impl() +{ +#ifdef DEBUG + Color aBC( GetBackground().GetColor() ); +#endif + ColorData nBgCol = COL_WHITE, + nTxtCol = COL_BLACK; + if (GetBackground().GetColor().IsDark()) + { + const StyleSettings &rS = GetSettings().GetStyleSettings(); + nBgCol = rS.GetFieldColor().GetColor(); + nTxtCol = rS.GetFieldTextColor().GetColor(); + } + + Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Color aTxtColor( nTxtCol ); + aCharsetDisplay .SetBackground( aWall ); + aCharsetDisplay .SetTextColor( aTxtColor ); + aOldSymbolDisplay.SetBackground( aWall ); + aOldSymbolDisplay.SetTextColor( aTxtColor ); + aSymbolDisplay .SetBackground( aWall ); + aSymbolDisplay .SetTextColor( aTxtColor ); +} + + +void SmSymDefineDialog::DataChanged( const DataChangedEvent& rDCEvt ) +{ + if ( rDCEvt.GetType() == DATACHANGED_SETTINGS && + (rDCEvt.GetFlags() & SETTINGS_STYLE) ) + InitColor_Impl(); + + ModalDialog::DataChanged( rDCEvt ); +} + + short SmSymDefineDialog::Execute() { short nResult = ModalDialog::Execute(); -- cgit v1.2.3 From 4fb803e82392e1cf453f6ec7f9a0189d9b4403a9 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Mon, 29 Apr 2002 11:40:02 +0000 Subject: #65293# TL: use of Wallpaper ctor fixed for g++ --- starmath/source/dialog.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 3bf47ef212b5..a7f96e0f88b3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: tl $ $Date: 2002-04-24 10:15:41 $ + * last change: $Author: vg $ $Date: 2002-04-29 12:40:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -496,7 +496,7 @@ void SmFontDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Wallpaper aWall( (Color) Color( nBgCol ) ); Color aTxtColor( nTxtCol ); aShowFont.SetBackground( aWall ); aShowFont.SetTextColor( aTxtColor ); @@ -1592,7 +1592,7 @@ void SmSymbolDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Wallpaper aWall( (Color) Color( nBgCol ) ); Color aTxtColor( nTxtCol ); aSymbolDisplay .SetBackground( aWall ); aSymbolDisplay .SetTextColor( aTxtColor ); @@ -2175,7 +2175,7 @@ void SmSymDefineDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( Color( (ColorData) nBgCol ) ); + Wallpaper aWall( (Color) Color( nBgCol ) ); Color aTxtColor( nTxtCol ); aCharsetDisplay .SetBackground( aWall ); aCharsetDisplay .SetTextColor( aTxtColor ); -- cgit v1.2.3 From 97b3ca1fe34427910394f09cb1da459c43975bfb Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Fri, 3 May 2002 13:35:00 +0000 Subject: #65293# added temporary objects --- starmath/source/dialog.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index a7f96e0f88b3..1ebff2e3eb30 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: vg $ $Date: 2002-04-29 12:40:02 $ + * last change: $Author: vg $ $Date: 2002-05-03 14:35:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -496,7 +496,8 @@ void SmFontDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( (Color) Color( nBgCol ) ); + Color aTmpColor( nBgCol ); + Wallpaper aWall( aTmpColor ); Color aTxtColor( nTxtCol ); aShowFont.SetBackground( aWall ); aShowFont.SetTextColor( aTxtColor ); @@ -1592,7 +1593,8 @@ void SmSymbolDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( (Color) Color( nBgCol ) ); + Color aTmpColor( nBgCol ); + Wallpaper aWall( aTmpColor ); Color aTxtColor( nTxtCol ); aSymbolDisplay .SetBackground( aWall ); aSymbolDisplay .SetTextColor( aTxtColor ); @@ -2175,7 +2177,8 @@ void SmSymDefineDialog::InitColor_Impl() nTxtCol = rS.GetFieldTextColor().GetColor(); } - Wallpaper aWall( (Color) Color( nBgCol ) ); + Color aTmpColor( nBgCol ); + Wallpaper aWall( aTmpColor ); Color aTxtColor( nTxtCol ); aCharsetDisplay .SetBackground( aWall ); aCharsetDisplay .SetTextColor( aTxtColor ); -- cgit v1.2.3 From 260810f6b0eb350aeb5c82fadb9ad4dcbfc0f9f2 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 24 May 2002 11:12:46 +0000 Subject: #98792# HC bitmaps for accessibility --- starmath/inc/dialog.hxx | 26 +++++--- starmath/source/dialog.cxx | 39 +++++++++--- starmath/source/smres.src | 148 +++++++++++++++++++++++++++++++++++++-------- 3 files changed, 172 insertions(+), 41 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 1aeee6233aad..2f941578ccb1 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: tl $ $Date: 2002-04-24 10:09:56 $ + * last change: $Author: tl $ $Date: 2002-05-24 12:11:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -289,10 +289,12 @@ class SmCategoryDesc : public Resource { XubString Name; XubString *Strings[4]; - Bitmap *Graphics[4]; - USHORT Minimum[4]; - USHORT Maximum[4]; - USHORT Value[4]; + Bitmap *Graphics[4]; /* regular bitmaps */ + Bitmap *GraphicsH[4]; /* high contrast bitmaps */ + USHORT Minimum[4]; + USHORT Maximum[4]; + USHORT Value[4]; + BOOL bIsHighContrast; public: SmCategoryDesc(const ResId &rResId, USHORT nCategoryIdx); @@ -300,11 +302,16 @@ public: const XubString & GetName() const { return Name; } const XubString * GetString(USHORT Index) const { return Strings[Index]; } - const Bitmap * GetGraphic(USHORT Index) const { return Graphics[Index]; } USHORT GetMinimum(USHORT Index) { return Minimum[Index]; } USHORT GetMaximum(USHORT Index) { return Maximum[Index]; } USHORT GetValue(USHORT Index) const { return Value[Index]; } void SetValue(USHORT Index, USHORT nVal) { Value[Index] = nVal;} + + void SetHighContrast( BOOL bVal ) { bIsHighContrast = bVal; } + const Bitmap * GetGraphic(USHORT Index) const + { + return bIsHighContrast ? GraphicsH[Index] : Graphics[Index]; + } }; @@ -338,12 +345,17 @@ class SmDistanceDialog : public ModalDialog void SetHelpId(MetricField &rField, ULONG nHelpId); void SetCategory(USHORT Category); + void ApplyImages(); + public: SmDistanceDialog(Window *pParent, BOOL bFreeRes = TRUE); ~SmDistanceDialog(); void ReadFrom(const SmFormat &rFormat); void WriteTo (SmFormat &rFormat) /*const*/; + + // Window + virtual void DataChanged( const DataChangedEvent &rEvt ); }; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 1ebff2e3eb30..5c89271f5f4e 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: vg $ $Date: 2002-05-03 14:35:00 $ + * last change: $Author: tl $ $Date: 2002-05-24 12:12:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -750,7 +750,8 @@ static const FieldMinMax pMinMaxData[10][4] = }; SmCategoryDesc::SmCategoryDesc(const ResId& rResId, USHORT nCategoryIdx) : - Resource(rResId) + Resource(rResId), + bIsHighContrast(FALSE) { if (IsAvailableRes(ResId(1).SetRT(RSC_STRING))) { @@ -763,13 +764,15 @@ SmCategoryDesc::SmCategoryDesc(const ResId& rResId, USHORT nCategoryIdx) : if (IsAvailableRes(ResId(nI2).SetRT(RSC_STRING))) { - Strings[i] = new XubString(ResId(nI2)); - Graphics[i] = new Bitmap(ResId(nI2)); + Strings [i] = new XubString(ResId(nI2)); + Graphics [i] = new Bitmap(ResId(10*nI2)); + GraphicsH[i] = new Bitmap(ResId(10*nI2+1)); } else { - Strings[i] = 0; - Graphics[i] = 0; + Strings [i] = 0; + Graphics [i] = 0; + GraphicsH[i] = 0; } } @@ -1023,6 +1026,8 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) if (bFreeRes) FreeResource(); + ApplyImages(); + // preview like controls should have a 2D look aBitmap.SetBorderStyle( WINDOW_BORDER_MONO ); @@ -1035,7 +1040,7 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) aMenuButton.GetPopupMenu()->SetSelectHdl(LINK(this, SmDistanceDialog, MenuSelectHdl)); aDefaultButton.SetClickHdl(LINK(this, SmDistanceDialog, DefaultButtonClickHdl)); - } +} SmDistanceDialog::~SmDistanceDialog() @@ -1044,6 +1049,24 @@ SmDistanceDialog::~SmDistanceDialog() DELETEZ(Categories[i]); } +void SmDistanceDialog::ApplyImages() +{ + BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + for (int i = 0; i < NOCATEGORIES; ++i) + { + SmCategoryDesc *pCat = Categories[i]; + if (pCat) + pCat->SetHighContrast( bHighContrast ); + } +} + +void SmDistanceDialog::DataChanged( const DataChangedEvent &rEvt ) +{ + if ( (rEvt.GetType() == DATACHANGED_SETTINGS) && (rEvt.GetFlags() & SETTINGS_STYLE) ) + ApplyImages(); + + ModalDialog::DataChanged( rEvt ); +} void SmDistanceDialog::ReadFrom(const SmFormat &rFormat) { diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 23eda2cb6205..f149e8d29366 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -2,9 +2,9 @@ * * $RCSfile: smres.src,v $ * - * $Revision: 1.74 $ + * $Revision: 1.75 $ * - * last change: $Author: tl $ $Date: 2002-05-24 07:33:10 $ + * last change: $Author: tl $ $Date: 2002-05-24 12:12:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1414,10 +1414,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Espacio:"; Text[ thai ] = "~ระยะห่าง"; }; - Bitmap 2 + Bitmap 20 { File = "dist11.bmp" ; }; + Bitmap 21 + { + File = "dist11_h.bmp" ; + }; String 3 { Text = "~Zeilenabstand" ; @@ -1444,10 +1448,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Interlineado:"; Text[ thai ] = "ระยะห่าง~บรรทัด"; }; - Bitmap 3 + Bitmap 30 { File = "dist12.bmp" ; }; + Bitmap 31 + { + File = "dist12_h.bmp" ; + }; String 4 { Text = "~Wurzelabstand" ; @@ -1474,10 +1482,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Intervalo de ~raíz:"; Text[ thai ] = "ระยะห่าง~ราà¸"; }; - Bitmap 4 + Bitmap 40 { File = "dist13.bmp" ; }; + Bitmap 41 + { + File = "dist13_h.bmp" ; + }; }; Resource 2 { @@ -1533,10 +1545,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Superíndice:"; Text[ thai ] = "~ตัวยà¸"; }; - Bitmap 2 + Bitmap 20 { File = "dist21.bmp" ; }; + Bitmap 21 + { + File = "dist21_h.bmp" ; + }; String 3 { Text = "~Tiefstellung" ; @@ -1563,10 +1579,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "S~ubíndice:"; Text[ thai ] = "ตั~วห้อย"; }; - Bitmap 3 + Bitmap 30 { File = "dist22.bmp" ; }; + Bitmap 31 + { + File = "dist22_h.bmp" ; + }; }; Resource 3 { @@ -1626,10 +1646,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Altura del ~numerador:"; Text[ thai ] = "เ~ศษ"; }; - Bitmap 2 + Bitmap 20 { File = "dist31.bmp" ; }; + Bitmap 21 + { + File = "dist31_h.bmp" ; + }; String 3 { Text = "~Nennertiefe" ; @@ -1656,10 +1680,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Altura del denominador:"; Text[ thai ] = "~ส่วน"; }; - Bitmap 3 + Bitmap 30 { File = "dist32.bmp" ; }; + Bitmap 31 + { + File = "dist32_h.bmp" ; + }; }; Resource 4 { @@ -1718,10 +1746,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Longitud ~excesiva:"; Text[ thai ] = "ความยาวเ~à¸à¸´à¸™"; }; - Bitmap 2 + Bitmap 20 { File = "dist41.bmp" ; }; + Bitmap 21 + { + File = "dist41_h.bmp" ; + }; String 3 { /* ### ACHTUNG: Neuer Text in Resource? ~Strichstärke: : ~Strichstärke: */ @@ -1749,10 +1781,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Espesor del ~trazo:"; Text[ thai ] = "~น้ำหนัà¸"; }; - Bitmap 3 + Bitmap 30 { File = "dist42.bmp" ; }; + Bitmap 31 + { + File = "dist42_h.bmp" ; + }; }; Resource 5 { @@ -1811,10 +1847,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Altura máxima:"; Text[ thai ] = "ขีดจำà¸à¸±à¸”~บน"; }; - Bitmap 2 + Bitmap 20 { File = "dist51.bmp" ; }; + Bitmap 21 + { + File = "dist51_h.bmp" ; + }; String 3 { Text = "Grenz~tiefe" ; @@ -1841,10 +1881,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Altura ~mínima:"; Text[ thai ] = "ขีดจำà¸à¸±à¸”~ล่าง"; }; - Bitmap 3 + Bitmap 30 { File = "dist52.bmp" ; }; + Bitmap 31 + { + File = "dist52_h.bmp" ; + }; }; Resource 6 { @@ -1902,10 +1946,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Sobredimensión izq./der.:"; Text[ thai ] = "ขนาดเ~à¸à¸´à¸™ (ซ้าย/ขวา)"; }; - Bitmap 2 + Bitmap 20 { File = "dist61.bmp" ; }; + Bitmap 21 + { + File = "dist61_h.bmp" ; + }; String 3 { Text = "~Abstand" ; @@ -1932,10 +1980,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Espacio:"; Text[ thai ] = "~ระยะห่าง"; }; - Bitmap 3 + Bitmap 30 { File = "dist62.bmp" ; }; + Bitmap 31 + { + File = "dist62_h.bmp" ; + }; String 5 { Text = "~Übergröße" ; @@ -1962,10 +2014,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Sobredimensión:"; Text[ thai ] = "ขนาดเ~à¸à¸´à¸™"; }; - Bitmap 5 + Bitmap 50 { File = "dist61.bmp" ; }; + Bitmap 51 + { + File = "dist61_h.bmp" ; + }; }; Resource 7 { @@ -2023,10 +2079,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Interlineado:"; Text[ thai ] = "ระยะห่าง~บรรทัด"; }; - Bitmap 2 + Bitmap 20 { File = "dist71.bmp" ; }; + Bitmap 21 + { + File = "dist71_h.bmp" ; + }; String 3 { Text = "~Spaltenabstand" ; @@ -2053,10 +2113,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Distancia entre ~columnas:"; Text[ thai ] = "ระยะห่าง~คอลัมน์"; }; - Bitmap 3 + Bitmap 30 { File = "dist72.bmp" ; }; + Bitmap 31 + { + File = "dist72_h.bmp" ; + }; }; Resource 8 { @@ -2115,10 +2179,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Altura ~primaria:"; Text[ thai ] = "ความสูง~ปà¸à¸¡à¸ à¸¹à¸¡à¸´"; }; - Bitmap 2 + Bitmap 20 { File = "dist81.bmp" ; }; + Bitmap 21 + { + File = "dist81_h.bmp" ; + }; String 3 { Text = "~Mindestabstand" ; @@ -2145,10 +2213,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "Distancia ~mínima:"; Text[ thai ] = "ระยะห่าง~น้อยที่สุด"; }; - Bitmap 3 + Bitmap 30 { File = "dist82.bmp" ; }; + Bitmap 31 + { + File = "dist82_h.bmp" ; + }; }; Resource 9 { @@ -2207,10 +2279,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Sobredimensión:"; Text[ thai ] = "ขนาดเ~à¸à¸´à¸™"; }; - Bitmap 2 + Bitmap 20 { File = "dist91.bmp" ; }; + Bitmap 21 + { + File = "dist91_h.bmp" ; + }; String 3 { Text = "~Abstand" ; @@ -2237,10 +2313,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Espacio:"; Text[ thai ] = "~ระยะห่าง"; }; - Bitmap 3 + Bitmap 30 { File = "dist92.bmp" ; }; + Bitmap 31 + { + File = "dist92_h.bmp" ; + }; }; Resource 10 { @@ -2297,10 +2377,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Izquierda:"; Text[ thai ] = "~ซ้าย"; }; - Bitmap 2 + Bitmap 20 { File = "dist101.bmp" ; }; + Bitmap 21 + { + File = "dist101_h.bmp" ; + }; String 3 { Text = "~Rechts" ; @@ -2327,10 +2411,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Derecha:"; Text[ thai ] = "~ขวา"; }; - Bitmap 3 + Bitmap 30 { File = "dist102.bmp" ; }; + Bitmap 31 + { + File = "dist102_h.bmp" ; + }; String 4 { Text = "~Oben" ; @@ -2357,10 +2445,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Arriba:"; Text[ thai ] = "~บน"; }; - Bitmap 4 + Bitmap 40 { File = "dist103.bmp" ; }; + Bitmap 41 + { + File = "dist103_h.bmp" ; + }; String 5 { Text = "~Unten" ; @@ -2387,10 +2479,14 @@ ModalDialog RID_DISTANCEDIALOG Text[ catalan ] = "~Abajo:"; Text[ thai ] = "~ล่าง"; }; - Bitmap 5 + Bitmap 50 { File = "dist104.bmp" ; }; + Bitmap 51 + { + File = "dist104_h.bmp" ; + }; }; Text[ chinese_simplified ] = "é—´éš”"; Text[ russian ] = "Èíòåðâàëû"; -- cgit v1.2.3 From 56476e3a93527a2eb81643633b3c2f7d23394c44 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 24 May 2002 11:50:39 +0000 Subject: #98792# HC bitmaps for accessibility --- starmath/source/dialog.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 5c89271f5f4e..e40a3c81c0c3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: tl $ $Date: 2002-05-24 12:12:18 $ + * last change: $Author: tl $ $Date: 2002-05-24 12:50:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -792,8 +792,9 @@ SmCategoryDesc::~SmCategoryDesc() { for (int i = 0; i < 4; i++) { - delete Strings[i]; - delete Graphics[i]; + delete Strings [i]; + delete Graphics [i]; + delete GraphicsH[i]; } } -- cgit v1.2.3 From 222cdf953fa44d609fde68225da84e1e066a2395 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 24 May 2002 12:27:00 +0000 Subject: #99081# alingment of fonts in dialog fixed --- starmath/source/dialog.cxx | 7 +++++-- starmath/source/symbol.cxx | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index e40a3c81c0c3..038e84df773e 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: tl $ $Date: 2002-05-24 12:50:39 $ + * last change: $Author: tl $ $Date: 2002-05-24 13:27:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1235,6 +1235,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) { SmSym aSymbol (aSymbolSet.GetSymbol(i)); Font aFont (aSymbol.GetFace()); + aFont.SetAlign(ALIGN_TOP); // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben // (hoffentlich auch genug für links und rechts!) @@ -1438,6 +1439,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) Font aFont (pSymbol->GetFace()); aFont.SetSize(Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); + aFont.SetAlign(ALIGN_TOP); SetFont(aFont); // keep old text color (font may have different color set) @@ -1715,6 +1717,7 @@ void SmShowChar::SetFont(const Font &rFont) Size aSize (Size(0, GetOutputSize().Height() - GetOutputSize().Height() / 3)); aFont.SetSize(aSize); + aFont.SetAlign(ALIGN_TOP); aFont.SetTransparent(TRUE); Control::SetFont(aFont); diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 95d10ad16ba8..a61280ceed7b 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symbol.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: tl $ $Date: 2001-10-02 12:58:24 $ + * last change: $Author: tl $ $Date: 2002-05-24 13:27:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,7 @@ SmSym::SmSym() : { aExportName = Name; Face.SetTransparent(TRUE); + Face.SetAlign(ALIGN_BASELINE); } @@ -156,7 +157,11 @@ SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar, const String& rSet, BOOL bIsPredefined) { Name = aExportName = rName; + Face = rFont; + Face.SetTransparent(TRUE); + Face.SetAlign(ALIGN_BASELINE); + Character = aChar; if (RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet()) Character |= 0xF000; -- cgit v1.2.3 From 52b257c3754abbc393fbfd10c599e765ae7d4ed8 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 12 Jul 2002 06:26:02 +0000 Subject: #100177# use Window::GetDisplayBackground now where possible instead of OutputDevice::GetBackground --- starmath/source/dialog.cxx | 16 ++++++++-------- starmath/source/document.cxx | 22 ++++++++++++++++++++-- starmath/source/node.cxx | 12 ++++++------ 3 files changed, 34 insertions(+), 16 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 038e84df773e..a92f40efd12a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: tl $ $Date: 2002-05-24 13:27:00 $ + * last change: $Author: tl $ $Date: 2002-07-12 07:26:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -485,11 +485,11 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) void SmFontDialog::InitColor_Impl() { #ifdef DEBUG - Color aBC( GetBackground().GetColor() ); + Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetBackground().GetColor().IsDark()) + if (GetDisplayBackground().GetColor().IsDark()) { const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); @@ -1608,11 +1608,11 @@ SmSymbolDialog::~SmSymbolDialog() void SmSymbolDialog::InitColor_Impl() { #ifdef DEBUG - Color aBC( GetBackground().GetColor() ); + Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetBackground().GetColor().IsDark()) + if (GetDisplayBackground().GetColor().IsDark()) { const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); @@ -2193,11 +2193,11 @@ SmSymDefineDialog::~SmSymDefineDialog() void SmSymDefineDialog::InitColor_Impl() { #ifdef DEBUG - Color aBC( GetBackground().GetColor() ); + Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetBackground().GetColor().IsDark()) + if (GetDisplayBackground().GetColor().IsDark()) { const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 0873cb51d01b..d7d0d3d31e5a 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -2,9 +2,9 @@ * * $RCSfile: document.cxx,v $ * - * $Revision: 1.54 $ + * $Revision: 1.55 $ * - * last change: $Author: tl $ $Date: 2002-06-13 14:41:41 $ + * last change: $Author: tl $ $Date: 2002-07-12 07:26:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -571,7 +571,25 @@ void SmDocShell::Draw(OutputDevice &rDev, Point &rPosition) rPosition.X() += aFormat.GetDistance( DIS_LEFTSPACE ); rPosition.Y() += aFormat.GetDistance( DIS_TOPSPACE ); + + //! in case of high contrast-mode (accessibility option!) + //! the draw mode needs to be set to default, because when imbedding + //! Math for example in Calc in "a over b" the fraction bar may not + //! be visible else. More generally: the FillColor may have been changed. + ULONG nOldDrawMode = DRAWMODE_DEFAULT; + BOOL bRestoreDrawMode = FALSE; + if (OUTDEV_WINDOW == rDev.GetOutDevType() && + ((Window &) rDev).GetDisplayBackground().GetColor().IsDark()) + { + nOldDrawMode = rDev.GetDrawMode(); + rDev.SetDrawMode( DRAWMODE_DEFAULT ); + bRestoreDrawMode = TRUE; + } + pTree->Draw(rDev, rPosition); + + if (bRestoreDrawMode) + rDev.SetDrawMode( nOldDrawMode ); } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 951c8eacd590..c9b629e3bd1e 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2,9 +2,9 @@ * * $RCSfile: node.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: tl $ $Date: 2002-06-04 11:54:26 $ + * last change: $Author: tl $ $Date: 2002-07-12 07:26:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -177,7 +177,6 @@ SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, BOOL bUseMap100th_mm) : } } -#define DARK_COL 154 Color SmTmpDevice::Impl_GetColor( const Color& rColor ) { @@ -185,16 +184,17 @@ Color SmTmpDevice::Impl_GetColor( const Color& rColor ) if (COL_AUTO == rColor.GetColor()) { Color aBgCol( rOutDev.GetBackground().GetColor() ); - BOOL bIsDarkBg = DARK_COL > aBgCol.GetRed() + aBgCol.GetBlue() + aBgCol.GetGreen(); + if (OUTDEV_WINDOW == rOutDev.GetOutDevType()) + aBgCol = ((Window &) rOutDev).GetDisplayBackground().GetColor(); SmViewShell *pViewSh = SmGetActiveView(); if (pViewSh && OUTDEV_PRINTER != rOutDev.GetOutDevType()) { const StyleSettings& rS = pViewSh->GetGraphicWindow().GetSettings().GetStyleSettings(); - nNewCol = /*bIsDarkBg ? COL_WHITE :*/ rS.GetWindowTextColor().GetColor(); + nNewCol = rS.GetWindowTextColor().GetColor(); } else - nNewCol = bIsDarkBg ? COL_WHITE : COL_BLACK; + nNewCol = aBgCol.IsDark() ? COL_WHITE : COL_BLACK; } return Color( nNewCol ); } -- cgit v1.2.3 From 8195c4fb257d7cd340a3d3cbacf5551111ac1692 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Fri, 11 Apr 2003 16:50:54 +0000 Subject: INTEGRATION: CWS vcl07 (1.24.66); FILE MERGED 2003/04/07 08:41:30 hdu 1.24.66.1: #108272# use new unicode subset methods --- starmath/source/dialog.cxx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index a92f40efd12a..a272eded6b37 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: tl $ $Date: 2002-07-12 07:26:02 $ + * last change: $Author: vg $ $Date: 2003-04-11 17:50:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2440,21 +2440,20 @@ void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rSt pSubsetMap = new SubsetMap( &aFontCharMap ); // aFontsSubsetLB.Clear(); - if (pSubsetMap->GetSubsetCount() > 0) + bool bFirst = true; + const Subset* pSubset; + while( NULL != (pSubset = pSubsetMap->GetNextSubset( bFirst )) ) { - const Subset* pSubset = 0; - for (USHORT i = 0; 0 != (pSubset = pSubsetMap->GetSubsetByIndex(i)); ++i) - { - USHORT nPos = aFontsSubsetLB.InsertEntry( pSubset->GetName()); - aFontsSubsetLB.SetEntryData( nPos, (void *) pSubset ); - // subset must live at least as long as the selected font !!! - } - aFontsSubsetLB.SelectEntryPos( 0 ); - BOOL bEnable = aFontsSubsetLB.GetEntryCount() > 1; - if (!bEnable) - aFontsSubsetLB.SetNoSelection(); - aFontsSubsetLB.Enable( bEnable ); + USHORT nPos = aFontsSubsetLB.InsertEntry( pSubset->GetName()); + aFontsSubsetLB.SetEntryData( nPos, (void *) pSubset ); + // subset must live at least as long as the selected font !!! + if( bFirst ) + aFontsSubsetLB.SelectEntryPos( nPos ); + bFirst = false; } + if( bFirst ) + aFontsSubsetLB.SetNoSelection(); + aFontsSubsetLB.Enable( !bFirst ); } -- cgit v1.2.3 From 35e05775d1fa5047817d48f2ddfe90d2ed431772 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 15 Apr 2003 15:21:44 +0000 Subject: INTEGRATION: CWS dbgmacros1 (1.24.70); FILE MERGED 2003/04/10 08:37:06 kso 1.24.70.1: #108413# - debug macro unification. --- starmath/source/dialog.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index a272eded6b37..11cee076a226 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: vg $ $Date: 2003-04-11 17:50:54 $ + * last change: $Author: vg $ $Date: 2003-04-15 16:21:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -484,7 +484,7 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) void SmFontDialog::InitColor_Impl() { -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, @@ -1607,7 +1607,7 @@ SmSymbolDialog::~SmSymbolDialog() void SmSymbolDialog::InitColor_Impl() { -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, @@ -2192,7 +2192,7 @@ SmSymDefineDialog::~SmSymDefineDialog() void SmSymDefineDialog::InitColor_Impl() { -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 Color aBC( GetDisplayBackground().GetColor() ); #endif ColorData nBgCol = COL_WHITE, -- cgit v1.2.3 From 4396feeb84c8bfe8d33cb2b0f72cf420d221b3bf Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 6 Jan 2004 15:55:10 +0000 Subject: INTEGRATION: CWS vclcleanup02 (1.26.114); FILE MERGED 2003/12/11 08:50:30 mt 1.26.114.1: #i23061# VCL cleanup, removed headers, methods and types... --- starmath/source/dialog.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 11cee076a226..36dab105ac6e 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:21:44 $ + * last change: $Author: vg $ $Date: 2004-01-06 16:55:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -446,8 +446,6 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) { WaitObject( this ); - //Application::EnterWait(); - // get FontList from printer (if possible), otherwise from application window SmViewShell *pView = SmGetActiveView(); DBG_ASSERT(pView, "Sm : NULL pointer"); @@ -472,8 +470,6 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) // preview like controls should have a 2D look aShowFont.SetBorderStyle( WINDOW_BORDER_MONO ); - - //Application::LeaveWait(); } aFontBox.SetSelectHdl(LINK(this, SmFontDialog, FontSelectHdl)); -- cgit v1.2.3 From 7b4de16572405edb838b7e4c446f0ab09c408219 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 15 Nov 2004 15:42:16 +0000 Subject: INTEGRATION: CWS tl03 (1.27.94); FILE MERGED 2004/09/24 11:26:19 tl 1.27.94.1: #i32296# loading of text font attributes in XML import fixed --- starmath/source/dialog.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 36dab105ac6e..533f2d54acce 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: vg $ $Date: 2004-01-06 16:55:10 $ + * last change: $Author: obo $ $Date: 2004-11-15 16:42:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -186,7 +186,7 @@ const String & SmFontStyles::GetStyleName( const Font &rFont ) const { //! compare also SmSpecialNode::Prepare BOOL bBold = rFont.GetWeight() > WEIGHT_NORMAL, - bItalic = rFont.GetItalic() != ITALIC_NONE; + bItalic = rFont.GetItalic() > ITALIC_NONE; if (bBold && bItalic) return aBoldItalic; @@ -423,8 +423,8 @@ void SmFontDialog::SetFont(const Font &rFont) Face = rFont; aFontBox.SetText(Face.GetName()); - aBoldCheckBox.Check(Face.GetWeight() == WEIGHT_BOLD); - aItalicCheckBox.Check(Face.GetItalic() != ITALIC_NONE); + aBoldCheckBox.Check(Face.GetWeight() > WEIGHT_BOLD); + aItalicCheckBox.Check(Face.GetItalic() > ITALIC_NONE); aShowFont.SetFont(Face); } -- cgit v1.2.3 From fa8d5f67d76c9dbbf8042cc7ece485ab2746f601 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 16 Feb 2005 16:58:03 +0000 Subject: INTEGRATION: CWS dr33 (1.28.26); FILE MERGED 2005/02/14 16:56:32 dr 1.28.26.1: #i42367# remove non-ASCII characters from C++ sources --- starmath/source/dialog.cxx | 116 ++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 533f2d54acce..8e33fbf7073b 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: obo $ $Date: 2004-11-15 16:42:16 $ + * last change: $Author: vg $ $Date: 2005-02-16 17:58:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,8 +147,8 @@ //////////////////////////////////////// // -// Da der FontStyle besser über die Attribute gesetzt/abgefragt wird als über -// den StyleName bauen wir uns hier unsere eigene Übersetzung +// Da der FontStyle besser ueber die Attribute gesetzt/abgefragt wird als ueber +// den StyleName bauen wir uns hier unsere eigene Uebersetzung // Attribute <-> StyleName // @@ -856,7 +856,7 @@ IMPL_LINK( SmDistanceDialog, CheckBoxClickHdl, CheckBox *, pCheckBox ) void SmDistanceDialog::SetHelpId(MetricField &rField, ULONG nHelpId) { - //! HelpID's die auf diese Weise explizit gesetzt werden, müssen im + //! HelpID's die auf diese Weise explizit gesetzt werden, muessen im //! util Verzeichnis im File "hidother.src" mit Hilfe von "hidspecial" //! definiert werden! @@ -884,7 +884,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) // array to convert category- and metricfield-number in help ids. // 0 is used in case of unused combinations. - DBG_ASSERT(NOCATEGORIES == 10, "Sm : Array paßt nicht zu Anzahl der Kategorien"); + DBG_ASSERT(NOCATEGORIES == 10, "Sm : Array passt nicht zu Anzahl der Kategorien"); ULONG __READONLY_DATA aCatMf2Hid[10][4] = { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, 0, @@ -926,8 +926,8 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) aMenuButton.GetPopupMenu()->CheckItem(nActiveCategory + 1, FALSE); } - // aktivieren/deaktivieren der zugehörigen Controls in Abhängigkeit von der - // gewählten Kategorie. + // aktivieren/deaktivieren der zugehoerigen Controls in Abhaengigkeit von der + // gewaehlten Kategorie. BOOL bActive; for (int i = 0; i < 4; i++) { @@ -935,7 +935,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) MetricField *pMF = (MetricField * const) aWin[i][1]; // Um feststellen welche Controls aktiv sein sollen wird das - // vorhandensein einer zugehörigen HelpID überprüft. + // vorhandensein einer zugehoerigen HelpID ueberprueft. bActive = aCatMf2Hid[nCategory][i] != 0; pFT->Show(bActive); @@ -943,7 +943,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) pMF->Show(bActive); pMF->Enable(bActive); - // setzen von Maßeinheit und Anzahl der Nachkommastellen + // setzen von Masseinheit und Anzahl der Nachkommastellen FieldUnit eUnit; USHORT nDigits; if (nCategory < 9) @@ -957,7 +957,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) eUnit = FUNIT_100TH_MM; nDigits = 2; } - pMF->SetUnit(eUnit); //! verändert den Wert + pMF->SetUnit(eUnit); //! veraendert den Wert pMF->SetDecimalDigits(nDigits); if (bActive) @@ -972,7 +972,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) SetHelpId(*pMF, aCatMf2Hid[nCategory][i]); } } - // nun noch die CheckBox und das zugehörige MetricField genau dann aktivieren, + // nun noch die CheckBox und das zugehoerige MetricField genau dann aktivieren, // falls es sich um das Klammer Menu handelt. bActive = nCategory == 5; aCheckBox1.Show(bActive); @@ -1103,8 +1103,8 @@ void SmDistanceDialog::ReadFrom(const SmFormat &rFormat) void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ { - // hmm... k”nnen die tats„chlich unterschiedlich sein? - // wenn nicht kann oben n„mlich das const stehen! + // hmm... koennen die tatsaechlich unterschiedlich sein? + // wenn nicht kann oben naemlich das const stehen! SetCategory(nActiveCategory); rFormat.SetDistance( DIS_HORIZONTAL, Categories[0]->GetValue(0) ); @@ -1220,7 +1220,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) { Push(PUSH_MAPMODE); - // MapUnit einstellen für die 'nLen' berechnet wurde + // MapUnit einstellen fuer die 'nLen' berechnet wurde SetMapMode(MapMode(MAP_PIXEL)); int v = (int) (aVScrollBar.GetThumbPos() * nColumns); @@ -1234,7 +1234,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) aFont.SetAlign(ALIGN_TOP); // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben - // (hoffentlich auch genug für links und rechts!) + // (hoffentlich auch genug fuer links und rechts!) aFont.SetSize(Size(0, nLen - (nLen / 3))); SetFont(aFont); // keep text color @@ -1328,7 +1328,7 @@ SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) : long nScrollBarWidth = aVScrollBar.GetSizePixel().Width(), nUseableWidth = aOutputSize.Width() - nScrollBarWidth; - // Höhe von 16pt in Pixeln (passend zu 'aOutputSize') + // Hoehe von 16pt in Pixeln (passend zu 'aOutputSize') nLen = (USHORT) LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); nColumns = nUseableWidth / nLen; @@ -1444,8 +1444,8 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) SetText(XubString(pSymbol->GetCharacter())); } - // 'Invalidate' füllt den background mit der background-Farbe. - // Falls der NULL pointer übergeben wurde reicht dies also zum löschen + // 'Invalidate' fuellt den background mit der background-Farbe. + // Falls der NULL pointer uebergeben wurde reicht dies also zum loeschen // der Anzeige Invalidate(); } @@ -1454,7 +1454,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) //////////////////////////////////////////////////////////////////////////////// void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) - // füllt die Einträge der möglichen 'SymbolsSet's im Dialog mit den + // fuellt die Eintraege der moeglichen 'SymbolsSet's im Dialog mit den // aktuellen Werten des SymbolSet Managers, selektiert aber keinen. { aSymbolSets.Clear(); @@ -1503,7 +1503,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) USHORT nSymPos = GetSelectedSymbol(); - // Dialog an evtl geänderte Daten des SymbolSet Manager anpassen + // Dialog an evtl geaenderte Daten des SymbolSet Manager anpassen if (pDialog->Execute() == RET_OK && rSymSetMgr.IsModified()) FillSymbolSets(); @@ -1769,7 +1769,7 @@ void SmSymDefineDialog::FillFonts(BOOL bDelete) // alle Fonts der 'FontList' in die Fontliste aufnehmen // von denen mit gleichen Namen jedoch nur einen (denn der Style wird - // über die 'FontStyleBox' gewählt und nicht auch noch hier) + // ueber die 'FontStyleBox' gewaehlt und nicht auch noch hier) DBG_ASSERT(pFontList, "Sm : NULL pointer"); USHORT nCount = pFontList->GetFontNameCount(); for (USHORT i = 0; i < nCount; i++) @@ -1921,11 +1921,11 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) { DBG_ASSERT(pButton == &aAddBtn, "Sm : falsches Argument"); - DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); SmSymSet *pSymSet = GetSymbolSet(aSymbolSets); - // SymbolSet einfügen falls es noch nicht existiert + // SymbolSet einfuegen falls es noch nicht existiert if (!pSymSet) { pSymSet = new SmSymSet(aSymbolSets.GetText()); @@ -1935,14 +1935,14 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) } DBG_ASSERT(pSymSet, "Sm : NULL pointer"); - // Symbol ins SymbolSet einfügen + // Symbol ins SymbolSet einfuegen SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(), aCharsetDisplay.GetSelectCharacter(), aSymbolSets.GetText()); pSymSet->AddSymbol(pSym); // update der Hash Tabelle erzwingen (damit aAddBtn disabled wird). - // (wird später nach Überarbeitung von symbol.cxx überflüssig werden). + // (wird spaeter nach Ueberarbeitung von symbol.cxx ueberfluessig werden). aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); // Symbolliste aktualiseren @@ -1958,7 +1958,7 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) { DBG_ASSERT(pButton == &aChangeBtn, "Sm : falsches Argument"); - DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); // finden des SymbolSets zum alten Symbol SmSymSet *pOldSymSet = GetSymbolSet(aOldSymbolSets); @@ -1966,7 +1966,7 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) // suchen des neuen SymbolSets SmSymSet *pNewSymSet = GetSymbolSet(aSymbolSets); - // SymbolSet einfügen falls es noch nicht existiert + // SymbolSet einfuegen falls es noch nicht existiert if (!pNewSymSet) { pNewSymSet = new SmSymSet(aSymbolSets.GetText()); @@ -1988,7 +1988,7 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) pSym->SetFace( aSymbolDisplay.GetFont() ); pSym->SetCharacter( aCharsetDisplay.GetSelectCharacter() ); - // das SymbolSet wechseln wenn nötig + // das SymbolSet wechseln wenn noetig if (pOldSymSet != pNewSymSet) { pNewSymSet->AddSymbol( new SmSym( *pSym ) ); @@ -2008,7 +2008,7 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) } //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, - //!! um mit möglich neuen bzw fehlenden alten Symbol Namen konform zu sein. + //!! um mit moeglich neuen bzw fehlenden alten Symbol Namen konform zu sein. aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); UpdateButtons(); @@ -2020,31 +2020,31 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) { DBG_ASSERT(pButton == &aDeleteBtn, "Sm : falsches Argument"); - DBG_ASSERT(aDeleteBtn.IsEnabled(), "Sm : Voraussetzungen erfüllt ??"); + DBG_ASSERT(aDeleteBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); if (pOrigSymbol) { - // löschen des Symbols: + // loeschen des Symbols: // - // zugehöriges SymbolSet finden + // zugehoeriges SymbolSet finden SmSymSet *pSymSet = GetSymbolSet(aOldSymbolSets); DBG_ASSERT(pSymSet, "Sm : NULL pointer"); // finden des Index XubString aOldSymbolName (pOrigSymbol->GetName()); USHORT nSymbolNo = pSymSet->GetSymbolPos(aOldSymbolName); DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol"); - // Bezüge auf das Symbols löschen + // Bezuege auf das Symbols loeschen SetOrigSymbol(NULL, XubString()); // und weg mit dem Symbol pSymSet->DeleteSymbol(nSymbolNo); //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, - //!! was er nämlich nicht tut, wenn in einem seiner SymbolSets geändert/ - //!! gelöscht wird, was wiederum zu einem Absturz führen kann (wenn er - //!! über ein nicht mehr existentes aber nicht entferntes Symbol iteriert). + //!! was er naemlich nicht tut, wenn in einem seiner SymbolSets geaendert/ + //!! geloescht wird, was wiederum zu einem Absturz fuehren kann (wenn er + //!! ueber ein nicht mehr existentes aber nicht entferntes Symbol iteriert). aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1); - // aktualisieren der Symboleinträge des Dialogs + // aktualisieren der Symboleintraege des Dialogs aOldSymbols.SetText(XubString()); aOldSymbols.RemoveEntry(aOldSymbolName); if (aSymbolSets.GetText() == aOldSymbolSets.GetText()) @@ -2079,15 +2079,15 @@ void SmSymDefineDialog::UpdateButtons() GetFontStyles().GetStyleName(pOrigSymbol->GetFace())) && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); - // hinzufügen nur wenn es noch kein Symbol desgleichen Namens gibt + // hinzufuegen nur wenn es noch kein Symbol desgleichen Namens gibt bAdd = aSymSetMgrCopy.GetSymbolByName(aSymbolName) == NULL; - // löschen nur wenn alle Einstellungen gleich sind + // loeschen nur wenn alle Einstellungen gleich sind bDelete = pOrigSymbol != NULL; - // ändern wenn bei gleichem Namen mindestens eine Einstellung anders ist - // oder wenn es noch kein Symbol des neuen Namens gibt (würde implizites - // löschen des bereits vorhandenen Symbols erfordern) + // aendern wenn bei gleichem Namen mindestens eine Einstellung anders ist + // oder wenn es noch kein Symbol des neuen Namens gibt (wuerde implizites + // loeschen des bereits vorhandenen Symbols erfordern) BOOL bEqualName = pOrigSymbol && aSymbolName == pOrigSymbol->GetName(); bChange = pOrigSymbol && (bEqualName && !bEqual || !bEqualName && bAdd); } @@ -2226,12 +2226,12 @@ short SmSymDefineDialog::Execute() { short nResult = ModalDialog::Execute(); - // Änderungen übernehmen falls Dialog mit OK beendet wurde + // Aenderungen uebernehmen falls Dialog mit OK beendet wurde if (aSymSetMgrCopy.IsModified() && nResult == RET_OK) { // leere SymbolSets aus dem Ergebnis entfernen. - // Dabei von hinten durch das array iterieren, da beim löschen die - // Elemente aufrücken. + // Dabei von hinten durch das array iterieren, da beim loeschen die + // Elemente aufruecken. USHORT nSymbolSets = aSymSetMgrCopy.GetSymbolSetCount(); for (int i = nSymbolSets - 1; i >= 0; i--) if (aSymSetMgrCopy.GetSymbolSet(i)->GetCount() == 0) @@ -2248,8 +2248,8 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr) { aSymSetMgrCopy = rMgr; - // Das modified Flag der Kopie auf FALSE setzen, damit man später damit - // testen kann ob sich was geändert hat. + // Das modified Flag der Kopie auf FALSE setzen, damit man spaeter damit + // testen kann ob sich was geaendert hat. aSymSetMgrCopy.SetModified(FALSE); FillSymbolSets(aOldSymbolSets); @@ -2295,16 +2295,16 @@ BOOL SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, BOOL bIsOld = &rComboBox == &aOldSymbolSets; - // setzen des SymbolSet Namens an der zugehörigen Darstellung + // setzen des SymbolSet Namens an der zugehoerigen Darstellung FixedText &rFT = bIsOld ? aOldSymbolSetName : aSymbolSetName; rFT.SetText(rComboBox.GetText()); - // setzen der zum SymbolSet gehörenden Symbol Namen an der zugehörigen + // setzen der zum SymbolSet gehoerenden Symbol Namen an der zugehoerigen // Auswahbox ComboBox &rCB = bIsOld ? aOldSymbols : aSymbols; FillSymbols(rCB, FALSE); - // bei Wechsel des SymbolSets für das alte Zeichen ein gültiges + // bei Wechsel des SymbolSets fuer das alte Zeichen ein gueltiges // Symbol bzw keins zur Anzeige bringen if (bIsOld) { @@ -2340,7 +2340,7 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, aOldSymbolDisplay.SetChar(pSymbol->GetCharacter()); } else - { // löschen des angezeigten Symbols + { // loeschen des angezeigten Symbols aOldSymbolDisplay.SetText(XubString()); aOldSymbolDisplay.Invalidate(); } @@ -2375,19 +2375,19 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, const SmSym *pSymbol = GetSymbol(aSymbols); if (pSymbol) { - // Font und Style entsprechend wählen + // Font und Style entsprechend waehlen const Font &rFont = pSymbol->GetFace(); SelectFont(rFont.GetName(), FALSE); SelectStyle(GetFontStyles().GetStyleName(rFont), FALSE); - // da das setzen des Fonts über den Style Namen des SymbolsFonts nicht + // da das setzen des Fonts ueber den Style Namen des SymbolsFonts nicht // so gut klappt (er kann zB leer sein obwohl der Font selbst 'bold' und - // 'italic' ist!). Setzen wir hier den Font wie er zum Symbol gehört - // zu Fuß. + // 'italic' ist!). Setzen wir hier den Font wie er zum Symbol gehoert + // zu Fuss. aCharsetDisplay.SetFont(rFont); aSymbolDisplay.SetFont(rFont); - // das zugehörige Zeichen auswählen + // das zugehoerige Zeichen auswaehlen SelectChar(pSymbol->GetCharacter()); } } @@ -2482,7 +2482,7 @@ BOOL SmSymDefineDialog::SelectStyle(const XubString &rStyleName, BOOL bApplyFont BOOL bRet = FALSE; USHORT nPos = aStyles.GetEntryPos(rStyleName); - // falls der Style nicht zur Auswahl steht nehmen wir den erst möglichen + // falls der Style nicht zur Auswahl steht nehmen wir den erst moeglichen // (sofern vorhanden) if (nPos == COMBOBOX_ENTRY_NOTFOUND && aStyles.GetEntryCount() > 0) nPos = 0; -- cgit v1.2.3 From d29d143d2f0a2bd42a0c11caff6f3920c77490f1 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 3 May 2005 12:51:22 +0000 Subject: INTEGRATION: CWS tl11 (1.29.10); FILE MERGED 2005/04/26 14:08:37 tl 1.29.10.1: #i43449# italic and bold fonts more clearly defined and SmFontDialog reworked --- starmath/source/dialog.cxx | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 8e33fbf7073b..765487706cb1 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.30 $ * - * last change: $Author: vg $ $Date: 2005-02-16 17:58:03 $ + * last change: $Author: obo $ $Date: 2005-05-03 13:51:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -185,8 +185,8 @@ SmFontStyles::SmFontStyles() : const String & SmFontStyles::GetStyleName( const Font &rFont ) const { //! compare also SmSpecialNode::Prepare - BOOL bBold = rFont.GetWeight() > WEIGHT_NORMAL, - bItalic = rFont.GetItalic() > ITALIC_NONE; + BOOL bBold = IsBold( rFont ), + bItalic = IsItalic( rFont ); if (bBold && bItalic) return aBoldItalic; @@ -422,15 +422,15 @@ void SmFontDialog::SetFont(const Font &rFont) { Face = rFont; - aFontBox.SetText(Face.GetName()); - aBoldCheckBox.Check(Face.GetWeight() > WEIGHT_BOLD); - aItalicCheckBox.Check(Face.GetItalic() > ITALIC_NONE); + aFontBox.SetText( Face.GetName() ); + aBoldCheckBox.Check( IsBold( Face ) ); + aItalicCheckBox.Check( IsItalic( Face ) ); aShowFont.SetFont(Face); } -SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) +SmFontDialog::SmFontDialog(Window * pParent, BOOL bHideCheckboxes, BOOL bFreeRes) : ModalDialog(pParent,SmResId(RID_FONTDIALOG)), aFixedText1 (this, ResId(1)), aFontBox (this, ResId(1)), @@ -476,6 +476,23 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bFreeRes) aFontBox.SetModifyHdl(LINK(this, SmFontDialog, FontModifyHdl)); aBoldCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); aItalicCheckBox.SetClickHdl(LINK(this, SmFontDialog, AttrChangeHdl)); + + if (bHideCheckboxes) + { + aBoldCheckBox.Check( FALSE ); + aBoldCheckBox.Enable( FALSE ); + aBoldCheckBox.Show( FALSE ); + aItalicCheckBox.Check( FALSE ); + aItalicCheckBox.Enable( FALSE ); + aItalicCheckBox.Show( FALSE ); + aFixedText2.Show( FALSE ); + + Size aSize( aFontBox.GetSizePixel() ); + long nComboBoxBottom = aFontBox.GetPosPixel().Y() + aFontBox.GetSizePixel().Height(); + long nCheckBoxBottom = aItalicCheckBox.GetPosPixel().Y() + aItalicCheckBox.GetSizePixel().Height(); + aSize.Height() += nCheckBoxBottom - nComboBoxBottom; + aFontBox.SetSizePixel( aSize ); + } } void SmFontDialog::InitColor_Impl() @@ -594,21 +611,22 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) { SmFontPickListBox *pActiveListBox; + BOOL bHideCheckboxes = FALSE; switch (pMenu->GetCurItemId()) { case 1: pActiveListBox = &aVariableFont; break; case 2: pActiveListBox = &aFunctionFont; break; case 3: pActiveListBox = &aNumberFont; break; case 4: pActiveListBox = &aTextFont; break; - case 5: pActiveListBox = &aSerifFont; break; - case 6: pActiveListBox = &aSansFont; break; - case 7: pActiveListBox = &aFixedFont; break; + case 5: pActiveListBox = &aSerifFont; bHideCheckboxes = TRUE; break; + case 6: pActiveListBox = &aSansFont; bHideCheckboxes = TRUE; break; + case 7: pActiveListBox = &aFixedFont; bHideCheckboxes = TRUE; break; default:pActiveListBox = NULL; } if (pActiveListBox) { - SmFontDialog *pFontDialog = new SmFontDialog(this); + SmFontDialog *pFontDialog = new SmFontDialog(this, bHideCheckboxes); pActiveListBox->WriteTo(*pFontDialog); if (pFontDialog->Execute() == RET_OK) -- cgit v1.2.3 From 0e3ad487ae1d314ed98eecd40e6f36cc3bebd154 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Wed, 7 Sep 2005 14:05:55 +0000 Subject: INTEGRATION: CWS ooo19126 (1.30.54); FILE MERGED 2005/09/05 17:37:29 rt 1.30.54.1: #i54170# Change license header: remove SISSL --- starmath/source/dialog.cxx | 68 ++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 47 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 765487706cb1..a8d62ce67f08 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: dialog.cxx,v $ - * - * $Revision: 1.30 $ - * - * last change: $Author: obo $ $Date: 2005-05-03 13:51:22 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 + * OpenOffice.org - a multi-platform office productivity suite * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: dialog.cxx,v $ * + * $Revision: 1.31 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: rt $ $Date: 2005-09-07 15:05:55 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library 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 for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ -- cgit v1.2.3 From 4a995ba6c323eab2e0d012fd103ddc45ce189054 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 5 Oct 2005 14:00:06 +0000 Subject: INTEGRATION: CWS tl12 (1.29.30); FILE MERGED 2005/09/27 01:43:41 tl 1.29.30.3: RESYNC: (1.30-1.31); FILE MERGED 2005/05/27 11:30:07 tl 1.29.30.2: RESYNC: (1.29-1.30); FILE MERGED 2005/05/02 08:44:09 tl 1.29.30.1: #i44468# have all documents use the same SmSymSetManager --- starmath/source/dialog.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index a8d62ce67f08..6c1886e040c4 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: rt $ $Date: 2005-09-07 15:05:55 $ + * last change: $Author: kz $ $Date: 2005-10-05 15:00:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1497,7 +1497,10 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) // Dialog an evtl geaenderte Daten des SymbolSet Manager anpassen if (pDialog->Execute() == RET_OK && rSymSetMgr.IsModified()) + { + rSymSetMgr.Save(); FillSymbolSets(); + } // wenn das alte SymbolSet nicht mehr existiert zum ersten gehen // (soweit eines vorhanden ist) @@ -1589,7 +1592,6 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre SmSymbolDialog::~SmSymbolDialog() { - rSymSetMgr.Save(); } @@ -2230,6 +2232,9 @@ short SmSymDefineDialog::Execute() aSymSetMgrCopy.DeleteSymbolSet(i); rSymSetMgr = aSymSetMgrCopy; +#ifdef DEBUG + USHORT nS = rSymSetMgr.GetSymbolSetCount(); +#endif } return nResult; @@ -2239,6 +2244,9 @@ short SmSymDefineDialog::Execute() void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr) { aSymSetMgrCopy = rMgr; +#ifdef DEBUG + USHORT nS = aSymSetMgrCopy.GetSymbolSetCount(); +#endif // Das modified Flag der Kopie auf FALSE setzen, damit man spaeter damit // testen kann ob sich was geaendert hat. -- cgit v1.2.3 From b29c974cd034152c89a9901966f8d6df34c211fc Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 31 Jan 2006 17:33:08 +0000 Subject: INTEGRATION: CWS tl17 (1.32.28); FILE MERGED 2006/01/06 06:51:07 tl 1.32.28.1: #121842# providing a device to be used to get the FontList avoid call to SmGetActiveView --- starmath/source/dialog.cxx | 59 +++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 32 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 6c1886e040c4..923af3224b6d 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: kz $ $Date: 2005-10-05 15:00:06 $ + * last change: $Author: kz $ $Date: 2006-01-31 18:33:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -404,7 +404,8 @@ void SmFontDialog::SetFont(const Font &rFont) } -SmFontDialog::SmFontDialog(Window * pParent, BOOL bHideCheckboxes, BOOL bFreeRes) +SmFontDialog::SmFontDialog(Window * pParent, + OutputDevice *pFntListDevice, BOOL bHideCheckboxes, BOOL bFreeRes) : ModalDialog(pParent,SmResId(RID_FONTDIALOG)), aFixedText1 (this, ResId(1)), aFontBox (this, ResId(1)), @@ -420,13 +421,8 @@ SmFontDialog::SmFontDialog(Window * pParent, BOOL bHideCheckboxes, BOOL bFreeRes { WaitObject( this ); - // get FontList from printer (if possible), otherwise from application window - SmViewShell *pView = SmGetActiveView(); - DBG_ASSERT(pView, "Sm : NULL pointer"); - OutputDevice *pDev = pView->GetDoc()->GetPrinter(); - if (!pDev || pDev->GetDevFontCount() == 0) - pDev = &pView->GetGraphicWindow(); - FontList aFontList(pDev); + + FontList aFontList( pFntListDevice ); USHORT nCount = aFontList.GetFontNameCount(); for (USHORT i = 0; i < nCount; i++) @@ -600,7 +596,7 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) if (pActiveListBox) { - SmFontDialog *pFontDialog = new SmFontDialog(this, bHideCheckboxes); + SmFontDialog *pFontDialog = new SmFontDialog(this, pFontListDev, bHideCheckboxes); pActiveListBox->WriteTo(*pFontDialog); if (pFontDialog->Execute() == RET_OK) @@ -628,7 +624,7 @@ IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButt IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) -SmFontTypeDialog::SmFontTypeDialog(Window * pParent, BOOL bFreeRes) +SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevice, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)), aFixedText1 (this, ResId(1)), aVariableFont (this, ResId(1)), @@ -649,7 +645,8 @@ SmFontTypeDialog::SmFontTypeDialog(Window * pParent, BOOL bFreeRes) aOKButton1 (this, ResId(1)), aCancelButton1 (this, ResId(1)), aMenuButton (this, ResId(1)), - aDefaultButton (this, ResId(2)) + aDefaultButton (this, ResId(2)), + pFontListDev (pFntListDevice) { if (bFreeRes) FreeResource(); @@ -1480,7 +1477,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) { DBG_ASSERT(pButton == &aEditBtn, "Sm : falsches Argument"); - SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, rSymSetMgr); + SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymSetMgr); // aktuelles Symbol und SymbolSet am neuen Dialog setzen const XubString aSymSetName (aSymbolSets.GetSelectEntry()), @@ -1555,7 +1552,8 @@ IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, pButton ) IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) -SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFreeRes) : +SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, + SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), aSymbolSetText (this, ResId(1)), aSymbolSets (this, ResId(1)), @@ -1565,7 +1563,8 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, SmSymSetManager &rMgr, BOOL bFre aCloseBtn (this, ResId(3)), aEditBtn (this, ResId(1)), aGetBtn (this, ResId(2)), - rSymSetMgr (rMgr) + rSymSetMgr (rMgr), + pFontListDev (pFntListDevice) { if (bFreeRes) FreeResource(); @@ -1764,10 +1763,12 @@ void SmSymDefineDialog::FillFonts(BOOL bDelete) // alle Fonts der 'FontList' in die Fontliste aufnehmen // von denen mit gleichen Namen jedoch nur einen (denn der Style wird // ueber die 'FontStyleBox' gewaehlt und nicht auch noch hier) - DBG_ASSERT(pFontList, "Sm : NULL pointer"); - USHORT nCount = pFontList->GetFontNameCount(); - for (USHORT i = 0; i < nCount; i++) - aFonts.InsertEntry( pFontList->GetFontName(i).GetName() ); + if (pFontList) + { + USHORT nCount = pFontList->GetFontNameCount(); + for (USHORT i = 0; i < nCount; i++) + aFonts.InsertEntry( pFontList->GetFontName(i).GetName() ); + } } @@ -2092,7 +2093,8 @@ void SmSymDefineDialog::UpdateButtons() } -SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BOOL bFreeRes) : +SmSymDefineDialog::SmSymDefineDialog(Window * pParent, + OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), aOldSymbolText (this, ResId(1)), aOldSymbols (this, ResId(1)), @@ -2128,14 +2130,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO if (bFreeRes) FreeResource(); - // get FontList from printer (if possible), otherwise from application window - SmViewShell *pView = SmGetActiveView(); - DBG_ASSERT(pView, "Sm : NULL pointer"); - OutputDevice *pDev = pView->GetDoc()->GetPrinter(); - if (!pDev || pDev->GetDevFontCount() == 0) - pDev = &pView->GetGraphicWindow(); - pFontList = new FontList(pDev); - + pFontList = new FontList( pFntListDevice ); pOrigSymbol = 0; @@ -2174,7 +2169,6 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, SmSymSetManager &rMgr, BO SmSymDefineDialog::~SmSymDefineDialog() { - delete pFontList; delete pSubsetMap; delete pOrigSymbol; } @@ -2421,8 +2415,9 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rStyleName) { // Font (FontInfo) passend zu Namen und Style holen - DBG_ASSERT(pFontList, "Sm : NULL pointer"); - FontInfo aFI( pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE) ); + FontInfo aFI; + if (pFontList) + aFI = pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE); SetFontStyle(rStyleName, aFI); aCharsetDisplay.SetFont(aFI); -- cgit v1.2.3 From a2b8aef9326d4ee685fd90af11d6b0300a0082b2 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Fri, 5 May 2006 07:00:16 +0000 Subject: INTEGRATION: CWS tl18 (1.32.36); FILE MERGED 2006/01/24 13:00:21 tl 1.32.36.1: #i60111# avoid use of SmGetActiveView(SfxViewShell::Current) as much as possible --- starmath/source/dialog.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 923af3224b6d..41f495293a88 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: kz $ $Date: 2006-01-31 18:33:07 $ + * last change: $Author: rt $ $Date: 2006-05-05 08:00:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1531,11 +1531,9 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, pButton ) XubString aText ('%'); aText += pSym->GetName(); - SmViewShell *pViewSh = SmGetActiveView(); - if (pViewSh) - pViewSh->GetViewFrame()->GetDispatcher()->Execute( - SID_INSERTTEXT, SFX_CALLMODE_STANDARD, - new SfxStringItem(SID_INSERTTEXT, aText), 0L); + rViewSh.GetViewFrame()->GetDispatcher()->Execute( + SID_INSERTTEXT, SFX_CALLMODE_STANDARD, + new SfxStringItem(SID_INSERTTEXT, aText), 0L); } return 0; @@ -1553,7 +1551,7 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, - SmSymSetManager &rMgr, BOOL bFreeRes) : + SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), aSymbolSetText (this, ResId(1)), aSymbolSets (this, ResId(1)), @@ -1564,6 +1562,7 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, aEditBtn (this, ResId(1)), aGetBtn (this, ResId(2)), rSymSetMgr (rMgr), + rViewSh (rViewShell), pFontListDev (pFntListDevice) { if (bFreeRes) -- cgit v1.2.3 From 9306e3dd4c137eac70a7739121882b85e1c0e13b Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Sun, 17 Sep 2006 06:52:10 +0000 Subject: INTEGRATION: CWS pchfix02 (1.34.44); FILE MERGED 2006/09/01 17:40:42 kaib 1.34.44.1: #i68856# Added header markers and pch files --- starmath/source/dialog.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 41f495293a88..33735f5c8052 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: rt $ $Date: 2006-05-05 08:00:16 $ + * last change: $Author: obo $ $Date: 2006-09-17 07:52:10 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,7 +33,9 @@ * ************************************************************************/ -#pragma hdrstop +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_starmath.hxx" + #define SMDLL 1 -- cgit v1.2.3 From a975a9db3276c38405b37c5f140478eeda11d028 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 26 Apr 2007 07:14:32 +0000 Subject: INTEGRATION: CWS residcleanup (1.35.66); FILE MERGED 2007/03/04 09:37:29 pl 1.35.66.1: #i74635# ResId cleanup --- starmath/source/dialog.cxx | 264 ++++++++++++++++++++++----------------------- 1 file changed, 132 insertions(+), 132 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 33735f5c8052..d83986b662f2 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: obo $ $Date: 2006-09-17 07:52:10 $ + * last change: $Author: rt $ $Date: 2007-04-26 08:14:32 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -146,9 +146,9 @@ public: SmFontStyles::SmFontStyles() : - aNormal ( ResId( RID_FONTREGULAR, SM_MOD()->GetResMgr() ) ), - aBold ( ResId( RID_FONTBOLD, SM_MOD()->GetResMgr() ) ), - aItalic ( ResId( RID_FONTITALIC, SM_MOD()->GetResMgr() ) ) + aNormal ( ResId( RID_FONTREGULAR, *SM_MOD()->GetResMgr() ) ), + aBold ( ResId( RID_FONTBOLD, *SM_MOD()->GetResMgr() ) ), + aItalic ( ResId( RID_FONTITALIC, *SM_MOD()->GetResMgr() ) ) { // SM_MOD()->GetResMgr().FreeResource(); @@ -225,15 +225,15 @@ void SetFontStyle(const XubString &rStyleName, Font &rFont) SmAboutDialog::SmAboutDialog(Window *pParent, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_DEFAULTABOUT)), - aFixedText1 (this, ResId(1)), - aFixedText2 (this, ResId(2)), - aFixedText3 (this, ResId(3)), - aFixedText4 (this, ResId(4)), - aFixedText5 (this, ResId(5)), - aFixedText6 (this, ResId(6)), - aReleaseText (this, ResId(7)), - aFixedBitmap1(this, ResId(1)), - aOKButton1 (this, ResId(1)) + aFixedText1 (this, SmResId(1)), + aFixedText2 (this, SmResId(2)), + aFixedText3 (this, SmResId(3)), + aFixedText4 (this, SmResId(4)), + aFixedText5 (this, SmResId(5)), + aFixedText6 (this, SmResId(6)), + aReleaseText (this, SmResId(7)), + aFixedBitmap1(this, SmResId(1)), + aOKButton1 (this, SmResId(1)) { if (bFreeRes) FreeResource(); @@ -259,17 +259,17 @@ IMPL_LINK_INLINE_END( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButt SmPrintOptionsTabPage::SmPrintOptionsTabPage(Window *pParent, const SfxItemSet &rOptions) : SfxTabPage(pParent, SmResId(RID_PRINTOPTIONPAGE), rOptions), - aFixedLine1 (this, ResId( FL_PRINTOPTIONS )), - aTitle (this, ResId( CB_TITLEROW )), - aText (this, ResId( CB_EQUATION_TEXT )), - aFrame (this, ResId( CB_FRAME )), - aFixedLine2 (this, ResId( FL_PRINT_FORMAT )), - aSizeNormal (this, ResId( RB_ORIGINAL_SIZE )), - aSizeScaled (this, ResId( RB_FIT_TO_PAGE )), - aSizeZoomed (this, ResId( RB_ZOOM )), - aZoom (this, ResId( MF_ZOOM )), - aFixedLine3 (this, ResId( FL_MISC_OPTIONS )), - aNoRightSpaces (this, ResId( CB_IGNORE_SPACING )) + aFixedLine1 (this, SmResId( FL_PRINTOPTIONS )), + aTitle (this, SmResId( CB_TITLEROW )), + aText (this, SmResId( CB_EQUATION_TEXT )), + aFrame (this, SmResId( CB_FRAME )), + aFixedLine2 (this, SmResId( FL_PRINT_FORMAT )), + aSizeNormal (this, SmResId( RB_ORIGINAL_SIZE )), + aSizeScaled (this, SmResId( RB_FIT_TO_PAGE )), + aSizeZoomed (this, SmResId( RB_ZOOM )), + aZoom (this, SmResId( MF_ZOOM )), + aFixedLine3 (this, SmResId( FL_MISC_OPTIONS )), + aNoRightSpaces (this, SmResId( CB_IGNORE_SPACING )) { FreeResource(); @@ -409,14 +409,14 @@ void SmFontDialog::SetFont(const Font &rFont) SmFontDialog::SmFontDialog(Window * pParent, OutputDevice *pFntListDevice, BOOL bHideCheckboxes, BOOL bFreeRes) : ModalDialog(pParent,SmResId(RID_FONTDIALOG)), - aFixedText1 (this, ResId(1)), - aFontBox (this, ResId(1)), - aBoldCheckBox (this, ResId(1)), - aItalicCheckBox (this, ResId(2)), - aOKButton1 (this, ResId(1)), - aCancelButton1 (this, ResId(1)), - aShowFont (this, ResId(1)), - aFixedText2 (this, ResId(2)) + aFixedText1 (this, SmResId(1)), + aFontBox (this, SmResId(1)), + aBoldCheckBox (this, SmResId(1)), + aItalicCheckBox (this, SmResId(2)), + aOKButton1 (this, SmResId(1)), + aCancelButton1 (this, SmResId(1)), + aShowFont (this, SmResId(1)), + aFixedText2 (this, SmResId(2)) { if (bFreeRes) FreeResource(); @@ -520,22 +520,22 @@ IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, pButton ) SmFontSizeDialog::SmFontSizeDialog(Window * pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_FONTSIZEDIALOG)), - aFixedText1(this, ResId(1)), - aBaseSize(this, ResId(1)), - aFixedText4(this, ResId(4)), - aTextSize(this, ResId(4)), - aFixedText5(this, ResId(5)), - aIndexSize(this, ResId(5)), - aFixedText6(this, ResId(6)), - aFunctionSize(this, ResId(6)), - aFixedText7(this, ResId(7)), - aOperatorSize(this, ResId(7)), - aFixedText8(this, ResId(8)), - aBorderSize(this, ResId(8)), - aFixedLine1(this, ResId(1)), - aOKButton1(this, ResId(1)), - aCancelButton1(this, ResId(1)), - aDefaultButton(this, ResId(1)) + aFixedText1(this, SmResId(1)), + aBaseSize(this, SmResId(1)), + aFixedText4(this, SmResId(4)), + aTextSize(this, SmResId(4)), + aFixedText5(this, SmResId(5)), + aIndexSize(this, SmResId(5)), + aFixedText6(this, SmResId(6)), + aFunctionSize(this, SmResId(6)), + aFixedText7(this, SmResId(7)), + aOperatorSize(this, SmResId(7)), + aFixedText8(this, SmResId(8)), + aBorderSize(this, SmResId(8)), + aFixedLine1(this, SmResId(1)), + aOKButton1(this, SmResId(1)), + aCancelButton1(this, SmResId(1)), + aDefaultButton(this, SmResId(1)) { if (bFreeRes) FreeResource(); @@ -628,26 +628,26 @@ IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevice, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_FONTTYPEDIALOG)), - aFixedText1 (this, ResId(1)), - aVariableFont (this, ResId(1)), - aFixedText2 (this, ResId(2)), - aFunctionFont (this, ResId(2)), - aFixedText3 (this, ResId(3)), - aNumberFont (this, ResId(3)), - aFixedText4 (this, ResId(4)), - aTextFont (this, ResId(4)), - aFixedText5 (this, ResId(5)), - aSerifFont (this, ResId(5)), - aFixedText6 (this, ResId(6)), - aSansFont (this, ResId(6)), - aFixedText7 (this, ResId(7)), - aFixedFont (this, ResId(7)), - aFixedLine1 (this, ResId(1)), - aFixedLine2 (this, ResId(2)), - aOKButton1 (this, ResId(1)), - aCancelButton1 (this, ResId(1)), - aMenuButton (this, ResId(1)), - aDefaultButton (this, ResId(2)), + aFixedText1 (this, SmResId(1)), + aVariableFont (this, SmResId(1)), + aFixedText2 (this, SmResId(2)), + aFunctionFont (this, SmResId(2)), + aFixedText3 (this, SmResId(3)), + aNumberFont (this, SmResId(3)), + aFixedText4 (this, SmResId(4)), + aTextFont (this, SmResId(4)), + aFixedText5 (this, SmResId(5)), + aSerifFont (this, SmResId(5)), + aFixedText6 (this, SmResId(6)), + aSansFont (this, SmResId(6)), + aFixedText7 (this, SmResId(7)), + aFixedFont (this, SmResId(7)), + aFixedLine1 (this, SmResId(1)), + aFixedLine2 (this, SmResId(2)), + aOKButton1 (this, SmResId(1)), + aCancelButton1 (this, SmResId(1)), + aMenuButton (this, SmResId(1)), + aDefaultButton (this, SmResId(2)), pFontListDev (pFntListDevice) { if (bFreeRes) @@ -740,20 +740,20 @@ SmCategoryDesc::SmCategoryDesc(const ResId& rResId, USHORT nCategoryIdx) : Resource(rResId), bIsHighContrast(FALSE) { - if (IsAvailableRes(ResId(1).SetRT(RSC_STRING))) + if (IsAvailableRes(ResId(1,*rResId.GetResMgr()).SetRT(RSC_STRING))) { - Name = XubString(ResId(1)); + Name = XubString(ResId(1,*rResId.GetResMgr())); int i; for (i = 0; i < 4; i++) { int nI2 = i + 2; - if (IsAvailableRes(ResId(nI2).SetRT(RSC_STRING))) + if (IsAvailableRes(ResId(nI2,*rResId.GetResMgr()).SetRT(RSC_STRING))) { - Strings [i] = new XubString(ResId(nI2)); - Graphics [i] = new Bitmap(ResId(10*nI2)); - GraphicsH[i] = new Bitmap(ResId(10*nI2+1)); + Strings [i] = new XubString(ResId(nI2,*rResId.GetResMgr())); + Graphics [i] = new Bitmap(ResId(10*nI2,*rResId.GetResMgr())); + GraphicsH[i] = new Bitmap(ResId(10*nI2+1,*rResId.GetResMgr())); } else { @@ -990,21 +990,21 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_DISTANCEDIALOG)), - aFixedText1 (this, ResId(1)), - aFixedText2 (this, ResId(2)), - aFixedText3 (this, ResId(3)), - aFixedText4 (this, ResId(4)), - aMetricField1 (this, ResId(1)), - aMetricField2 (this, ResId(2)), - aMetricField3 (this, ResId(3)), - aMetricField4 (this, ResId(4)), - aOKButton1 (this, ResId(1)), - aCancelButton1 (this, ResId(1)), - aMenuButton (this, ResId(1)), - aDefaultButton (this, ResId(1)), - aCheckBox1 (this, ResId(1)), - aBitmap (this, ResId(1)), - aFixedLine (this, ResId(1)) + aFixedText1 (this, SmResId(1)), + aFixedText2 (this, SmResId(2)), + aFixedText3 (this, SmResId(3)), + aFixedText4 (this, SmResId(4)), + aMetricField1 (this, SmResId(1)), + aMetricField2 (this, SmResId(2)), + aMetricField3 (this, SmResId(3)), + aMetricField4 (this, SmResId(4)), + aOKButton1 (this, SmResId(1)), + aCancelButton1 (this, SmResId(1)), + aMenuButton (this, SmResId(1)), + aDefaultButton (this, SmResId(1)), + aCheckBox1 (this, SmResId(1)), + aBitmap (this, SmResId(1)), + aFixedLine (this, SmResId(1)) { for (int i = 0; i < NOCATEGORIES; i++) Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); @@ -1151,13 +1151,13 @@ IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, pButton ) SmAlignDialog::SmAlignDialog(Window * pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_ALIGNDIALOG)), - aLeft (this, ResId(1)), - aCenter (this, ResId(2)), - aRight (this, ResId(3)), - aFixedLine1 (this, ResId(1)), - aOKButton1 (this, ResId(1)), - aCancelButton1 (this, ResId(1)), - aDefaultButton (this, ResId(1)) + aLeft (this, SmResId(1)), + aCenter (this, SmResId(2)), + aRight (this, SmResId(3)), + aFixedLine1 (this, SmResId(1)), + aOKButton1 (this, SmResId(1)), + aCancelButton1 (this, SmResId(1)), + aDefaultButton (this, SmResId(1)) { if (bFreeRes) FreeResource(); @@ -1555,14 +1555,14 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), - aSymbolSetText (this, ResId(1)), - aSymbolSets (this, ResId(1)), - aSymbolSetDisplay (this, ResId(1)), - aSymbolName (this, ResId(2)), - aSymbolDisplay (this, ResId(2)), - aCloseBtn (this, ResId(3)), - aEditBtn (this, ResId(1)), - aGetBtn (this, ResId(2)), + aSymbolSetText (this, SmResId(1)), + aSymbolSets (this, SmResId(1)), + aSymbolSetDisplay (this, SmResId(1)), + aSymbolName (this, SmResId(2)), + aSymbolDisplay (this, SmResId(2)), + aCloseBtn (this, SmResId(3)), + aEditBtn (this, SmResId(1)), + aGetBtn (this, SmResId(2)), rSymSetMgr (rMgr), rViewSh (rViewShell), pFontListDev (pFntListDevice) @@ -2097,33 +2097,33 @@ void SmSymDefineDialog::UpdateButtons() SmSymDefineDialog::SmSymDefineDialog(Window * pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), - aOldSymbolText (this, ResId(1)), - aOldSymbols (this, ResId(1)), - aOldSymbolSetText (this, ResId(2)), - aOldSymbolSets (this, ResId(2)), - aCharsetDisplay (this, ResId(1)), - aSymbolText (this, ResId(9)), - aSymbols (this, ResId(4)), - aSymbolSetText (this, ResId(10)), - aSymbolSets (this, ResId(5)), - aFontText (this, ResId(3)), - aFonts (this, ResId(1)), - aFontsSubsetFT (this, ResId( FT_FONTS_SUBSET )), - aFontsSubsetLB (this, ResId( LB_FONTS_SUBSET )), - aStyleText (this, ResId(4)), - aStyles (this, ResId(3)), - aOldSymbolName (this, ResId(7)), - aOldSymbolDisplay (this, ResId(3)), - aOldSymbolSetName (this, ResId(8)), - aSymbolName (this, ResId(5)), - aSymbolDisplay (this, ResId(2)), - aSymbolSetName (this, ResId(6)), - aAddBtn (this, ResId(1)), - aChangeBtn (this, ResId(2)), - aDeleteBtn (this, ResId(3)), - aOkBtn (this, ResId(1)), - aCancelBtn (this, ResId(1)), - aRightArrow (this, ResId(1)), + aOldSymbolText (this, SmResId(1)), + aOldSymbols (this, SmResId(1)), + aOldSymbolSetText (this, SmResId(2)), + aOldSymbolSets (this, SmResId(2)), + aCharsetDisplay (this, SmResId(1)), + aSymbolText (this, SmResId(9)), + aSymbols (this, SmResId(4)), + aSymbolSetText (this, SmResId(10)), + aSymbolSets (this, SmResId(5)), + aFontText (this, SmResId(3)), + aFonts (this, SmResId(1)), + aFontsSubsetFT (this, SmResId( FT_FONTS_SUBSET )), + aFontsSubsetLB (this, SmResId( LB_FONTS_SUBSET )), + aStyleText (this, SmResId(4)), + aStyles (this, SmResId(3)), + aOldSymbolName (this, SmResId(7)), + aOldSymbolDisplay (this, SmResId(3)), + aOldSymbolSetName (this, SmResId(8)), + aSymbolName (this, SmResId(5)), + aSymbolDisplay (this, SmResId(2)), + aSymbolSetName (this, SmResId(6)), + aAddBtn (this, SmResId(1)), + aChangeBtn (this, SmResId(2)), + aDeleteBtn (this, SmResId(3)), + aOkBtn (this, SmResId(1)), + aCancelBtn (this, SmResId(1)), + aRightArrow (this, SmResId(1)), pFontList (NULL), pSubsetMap (NULL), rSymSetMgr (rMgr) -- cgit v1.2.3 From 221d1a94fd374e8d788aabfc7881f98ca96595d4 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Fri, 25 May 2007 11:33:41 +0000 Subject: INTEGRATION: CWS tl32 (1.35.20); FILE MERGED 2007/04/16 13:03:35 tl 1.35.20.6: #i69286# warning-free code 2007/01/31 10:06:22 tl 1.35.20.5: #i69286# casting sal_UCS4 to sal_Unicode for the time being 2006/12/20 12:17:02 tl 1.35.20.4: #i69286# warning-free code 2006/11/02 15:13:54 tl 1.35.20.3: #i69286# make starmath warning-free for unxsols4(.pro) 2006/11/01 13:10:05 tl 1.35.20.2: #i69286# make starmath warning-free for unxlngi6(.pro) 2006/10/30 10:35:13 tl 1.35.20.1: #i69286# make starmath warning-free --- starmath/source/dialog.cxx | 310 ++++++++++++++++++++++++++++++++------------- 1 file changed, 222 insertions(+), 88 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index d83986b662f2..b7391eeefd60 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.37 $ * - * last change: $Author: rt $ $Date: 2007-04-26 08:14:32 $ + * last change: $Author: vg $ $Date: 2007-05-25 12:33:41 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -180,7 +180,9 @@ const String & SmFontStyles::GetStyleName( USHORT nIdx ) const // 0 = "normal", 1 = "italic", // 2 = "bold", 3 = "bold italic" +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( nIdx < GetCount(), "index out of range" ); +#endif switch (nIdx) { case 0 : return aNormal; @@ -212,7 +214,9 @@ void SetFontStyle(const XubString &rStyleName, Font &rFont) for (i = 0; i < rStyles.GetCount(); i++) if (rStyleName.CompareTo( rStyles.GetStyleName(i) ) == COMPARE_EQUAL) break; +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(i < rStyles.GetCount(), "style-name unknown"); +#endif nIndex = i; } @@ -249,7 +253,7 @@ SmAboutDialog::SmAboutDialog(Window *pParent, BOOL bFreeRes) : /**************************************************************************/ -IMPL_LINK_INLINE_START( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, pButton ) +IMPL_LINK_INLINE_START( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, EMPTYARG/*pButton*/ ) { aZoom.Enable(aSizeZoomed.IsChecked()); return 0; @@ -377,7 +381,7 @@ IMPL_LINK( SmFontDialog, FontModifyHdl, ComboBox *, pComboBox ) } -IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, pCheckBox ) +IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, EMPTYARG /*pCheckBox*/ ) { if (aBoldCheckBox.IsChecked()) Face.SetWeight(FontWeight(WEIGHT_BOLD)); @@ -501,7 +505,7 @@ void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt ) /**************************************************************************/ -IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, pButton ) +IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); @@ -560,7 +564,7 @@ void SmFontSizeDialog::ReadFrom(const SmFormat &rFormat) void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const { - rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm(aBaseSize.GetValue())) ); + rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(aBaseSize.GetValue()))) ); rFormat.SetRelSize(SIZ_TEXT, (USHORT) aTextSize .GetValue()); rFormat.SetRelSize(SIZ_INDEX, (USHORT) aIndexSize .GetValue()); @@ -609,7 +613,7 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) } -IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) +IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); if (pQueryBox->Execute() == RET_YES) @@ -815,7 +819,7 @@ IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu ) } -IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, pButton ) +IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); @@ -852,7 +856,9 @@ void SmDistanceDialog::SetHelpId(MetricField &rField, ULONG nHelpId) //! definiert werden! const XubString aEmptyText; +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(aEmptyText.Len() == 0, "Sm: Ooops..."); +#endif rField.SetHelpId(nHelpId); rField.SetHelpText(aEmptyText); @@ -870,33 +876,37 @@ void SmDistanceDialog::SetHelpId(MetricField &rField, ULONG nHelpId) void SmDistanceDialog::SetCategory(USHORT nCategory) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(0 <= nCategory && nCategory < NOCATEGORIES, "Sm: falsche Kategorienummer in SmDistanceDialog"); +#endif // array to convert category- and metricfield-number in help ids. // 0 is used in case of unused combinations. +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(NOCATEGORIES == 10, "Sm : Array passt nicht zu Anzahl der Kategorien"); +#endif ULONG __READONLY_DATA aCatMf2Hid[10][4] = { - HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, 0, - HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , 0, 0, - HID_SMA_NUMERATOR_DIST, HID_SMA_DENOMINATOR_DIST, 0, 0, - HID_SMA_FRACLINE_EXCWIDTH, HID_SMA_FRACLINE_LINEWIDTH, 0, 0, - HID_SMA_UPPERLIMIT_DIST, HID_SMA_LOWERLIMIT_DIST, 0, 0, - HID_SMA_BRACKET_EXCHEIGHT, HID_SMA_BRACKET_DIST, 0, HID_SMA_BRACKET_EXCHEIGHT2, - HID_SMA_MATRIXROW_DIST, HID_SMA_MATRIXCOL_DIST, 0, 0, - HID_SMA_ATTRIBUT_DIST, HID_SMA_INTERATTRIBUT_DIST, 0, 0, - HID_SMA_OPERATOR_EXCHEIGHT, HID_SMA_OPERATOR_DIST, 0, 0, - HID_SMA_LEFTBORDER_DIST, HID_SMA_RIGHTBORDER_DIST, HID_SMA_UPPERBORDER_DIST, HID_SMA_LOWERBORDER_DIST + { HID_SMA_DEFAULT_DIST, HID_SMA_LINE_DIST, HID_SMA_ROOT_DIST, 0 }, + { HID_SMA_SUP_DIST, HID_SMA_SUB_DIST , 0, 0 }, + { HID_SMA_NUMERATOR_DIST, HID_SMA_DENOMINATOR_DIST, 0, 0 }, + { HID_SMA_FRACLINE_EXCWIDTH, HID_SMA_FRACLINE_LINEWIDTH, 0, 0 }, + { HID_SMA_UPPERLIMIT_DIST, HID_SMA_LOWERLIMIT_DIST, 0, 0 }, + { HID_SMA_BRACKET_EXCHEIGHT, HID_SMA_BRACKET_DIST, 0, HID_SMA_BRACKET_EXCHEIGHT2 }, + { HID_SMA_MATRIXROW_DIST, HID_SMA_MATRIXCOL_DIST, 0, 0 }, + { HID_SMA_ATTRIBUT_DIST, HID_SMA_INTERATTRIBUT_DIST, 0, 0 }, + { HID_SMA_OPERATOR_EXCHEIGHT, HID_SMA_OPERATOR_DIST, 0, 0 }, + { HID_SMA_LEFTBORDER_DIST, HID_SMA_RIGHTBORDER_DIST, HID_SMA_UPPERBORDER_DIST, HID_SMA_LOWERBORDER_DIST } }; // array to help iterate over the controls Window * __READONLY_DATA aWin[4][2] = { - &aFixedText1, &aMetricField1, - &aFixedText2, &aMetricField2, - &aFixedText3, &aMetricField3, - &aFixedText4, &aMetricField4 + { &aFixedText1, &aMetricField1 }, + { &aFixedText2, &aMetricField2 }, + { &aFixedText3, &aMetricField3 }, + { &aFixedText4, &aMetricField4 } }; SmCategoryDesc *pCat; @@ -920,7 +930,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) // aktivieren/deaktivieren der zugehoerigen Controls in Abhaengigkeit von der // gewaehlten Kategorie. BOOL bActive; - for (int i = 0; i < 4; i++) + for (USHORT i = 0; i < 4; i++) { FixedText *pFT = (FixedText * const) aWin[i][0]; MetricField *pMF = (MetricField * const) aWin[i][1]; @@ -990,6 +1000,7 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_DISTANCEDIALOG)), +<<<<<<< dialog.cxx aFixedText1 (this, SmResId(1)), aFixedText2 (this, SmResId(2)), aFixedText3 (this, SmResId(3)), @@ -1005,8 +1016,25 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) aCheckBox1 (this, SmResId(1)), aBitmap (this, SmResId(1)), aFixedLine (this, SmResId(1)) -{ - for (int i = 0; i < NOCATEGORIES; i++) +======= + aFixedText1 (this, ResId(1)), + aMetricField1 (this, ResId(1)), + aFixedText2 (this, ResId(2)), + aMetricField2 (this, ResId(2)), + aFixedText3 (this, ResId(3)), + aMetricField3 (this, ResId(3)), + aCheckBox1 (this, ResId(1)), + aFixedText4 (this, ResId(4)), + aMetricField4 (this, ResId(4)), + aOKButton1 (this, ResId(1)), + aCancelButton1 (this, ResId(1)), + aMenuButton (this, ResId(1)), + aDefaultButton (this, ResId(1)), + aBitmap (this, ResId(1)), + aFixedLine (this, ResId(1)) +>>>>>>> 1.35.20.6 +{ + for (USHORT i = 0; i < NOCATEGORIES; i++) Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); nActiveCategory = CATEGORY_NONE; bScaleAllBrackets = FALSE; @@ -1132,7 +1160,7 @@ void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ /**************************************************************************/ -IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, pButton ) +IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); @@ -1214,11 +1242,11 @@ void SmShowSymbolSet::Paint(const Rectangle&) // MapUnit einstellen fuer die 'nLen' berechnet wurde SetMapMode(MapMode(MAP_PIXEL)); - int v = (int) (aVScrollBar.GetThumbPos() * nColumns); - int nSymbols = (int) aSymbolSet.GetCount(); + USHORT v = sal::static_int_cast< USHORT >((aVScrollBar.GetThumbPos() * nColumns)); + USHORT nSymbols = aSymbolSet.GetCount(); Color aTxtColor( GetTextColor() ); - for (int i = v; i < nSymbols ; i++) + for (USHORT i = v; i < nSymbols ; i++) { SmSym aSymbol (aSymbolSet.GetSymbol(i)); Font aFont (aSymbol.GetFace()); @@ -1256,8 +1284,9 @@ void SmShowSymbolSet::MouseButtonDown(const MouseEvent& rMEvt) if (rMEvt.IsLeft() && Rectangle(Point(0, 0), aOutputSize).IsInside(rMEvt.GetPosPixel())) { - SelectSymbol ((rMEvt.GetPosPixel().Y() / nLen) * nColumns + (rMEvt.GetPosPixel().X() / nLen) + - aVScrollBar.GetThumbPos() * nColumns); + long nPos = (rMEvt.GetPosPixel().Y() / nLen) * nColumns + (rMEvt.GetPosPixel().X() / nLen) + + aVScrollBar.GetThumbPos() * nColumns; + SelectSymbol( sal::static_int_cast< USHORT >(nPos) ); aSelectHdlLink.Call(this); @@ -1275,8 +1304,8 @@ void SmShowSymbolSet::KeyInput(const KeyEvent& rKEvt) { switch (rKEvt.GetKeyCode().GetCode()) { - case KEY_DOWN: n += nColumns; break; - case KEY_UP: n -= nColumns; break; + case KEY_DOWN: n = n + nColumns; break; + case KEY_UP: n = n - nColumns; break; case KEY_LEFT: n -= 1; break; case KEY_RIGHT: n += 1; break; case KEY_HOME: n = 0; break; @@ -1322,12 +1351,14 @@ SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) : // Hoehe von 16pt in Pixeln (passend zu 'aOutputSize') nLen = (USHORT) LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); - nColumns = nUseableWidth / nLen; + nColumns = sal::static_int_cast< USHORT >(nUseableWidth / nLen); if (nColumns > 2 && nColumns % 2 != 0) nColumns--; - nRows = aOutputSize.Height() / nLen; + nRows = sal::static_int_cast< USHORT >(aOutputSize.Height() / nLen); +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(nColumns > 0, "Sm : keine Spalten"); DBG_ASSERT(nRows > 0, "Sm : keine Zeilen"); +#endif // genau passend machen aOutputSize.Width() = nColumns * nLen; @@ -1389,7 +1420,7 @@ void SmShowSymbolSet::SelectSymbol(USHORT nSymbol) } -IMPL_LINK( SmShowSymbolSet, ScrollHdl, ScrollBar*, pScrollBar) +IMPL_LINK( SmShowSymbolSet, ScrollHdl, ScrollBar*, EMPTYARG /*pScrollBar*/) { Invalidate(); return 0; @@ -1458,26 +1489,32 @@ void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) } -IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, pListBox ) +IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pListBox == &aSymbolSets, "Sm : falsches Argument"); +#endif SelectSymbolSet(aSymbolSets.GetSelectEntry()); return 0; } -IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, pShowSymbolSet ) +IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, EMPTYARG /*pShowSymbolSet*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); +#endif SelectSymbol(aSymbolSetDisplay.GetSelectSymbol()); return 0; } -IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) +IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aEditBtn, "Sm : falsches Argument"); +#endif SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymSetMgr); @@ -1513,9 +1550,11 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, pButton ) } -IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, pShowSymbolSet ) +IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, EMPTYARG /*pShowSymbolSet*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); +#endif GetClickHdl(&aGetBtn); EndDialog(RET_OK); @@ -1523,9 +1562,11 @@ IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, pShowSymbolSet } -IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, pButton ) +IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aGetBtn, "Sm : falscher Button"); +#endif const SmSym *pSym = GetSymbol(); if (pSym) @@ -1542,9 +1583,11 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, pButton ) } -IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, pButton ) +IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aCloseBtn, "Sm : falscher Button"); +#endif EndDialog(TRUE); return 0; @@ -1555,6 +1598,7 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), +<<<<<<< dialog.cxx aSymbolSetText (this, SmResId(1)), aSymbolSets (this, SmResId(1)), aSymbolSetDisplay (this, SmResId(1)), @@ -1563,8 +1607,18 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, aCloseBtn (this, SmResId(3)), aEditBtn (this, SmResId(1)), aGetBtn (this, SmResId(2)), - rSymSetMgr (rMgr), +======= + aSymbolSetText (this, ResId(1)), + aSymbolSets (this, ResId(1)), + aSymbolSetDisplay (this, ResId(1)), + aSymbolName (this, ResId(2)), + aSymbolDisplay (this, ResId(2)), + aGetBtn (this, ResId(2)), + aCloseBtn (this, ResId(3)), + aEditBtn (this, ResId(1)), rViewSh (rViewShell), +>>>>>>> 1.35.20.6 + rSymSetMgr (rMgr), pFontListDev (pFntListDevice) { if (bFreeRes) @@ -1640,7 +1694,9 @@ BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName) aSymbolSets.SelectEntryPos(nPos); USHORT nSymbolSetNo = rSymSetMgr.GetSymbolSetPos(aSymbolSets.GetSelectEntry()); pSymSet = rSymSetMgr.GetSymbolSet(nSymbolSetNo); +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pSymSet, "Sm : NULL pointer"); +#endif aSymbolSetDisplay.SetSymbolSet(*pSymSet); if (pSymSet->GetCount() > 0) @@ -1721,8 +1777,10 @@ void SmShowChar::SetFont(const Font &rFont) void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, BOOL bDeleteText) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, "Sm : falsche ComboBox"); +#endif rComboBox.Clear(); if (bDeleteText) @@ -1742,8 +1800,10 @@ void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, BOOL bDeleteText) void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, "Sm : falsche ComboBox"); +#endif rComboBox.Clear(); if (bDeleteText) @@ -1788,7 +1848,9 @@ void SmSymDefineDialog::FillStyles(BOOL bDeleteText) for (USHORT i = 0; i < rStyles.GetCount(); i++) aStyles.InsertEntry( rStyles.GetStyleName(i) ); +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(aStyles.GetEntryCount() > 0, "Sm : keine Styles vorhanden"); +#endif aStyles.SetText( aStyles.GetEntry(0) ); } } @@ -1796,9 +1858,10 @@ void SmSymDefineDialog::FillStyles(BOOL bDeleteText) SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, "Sm : falsche ComboBox"); - +#endif USHORT nSymbolSetNo = aSymSetMgrCopy.GetSymbolSetPos(rComboBox.GetText()); return nSymbolSetNo == SYMBOLSET_NONE ? @@ -1808,24 +1871,29 @@ SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox) SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, "Sm : falsche ComboBox"); - +#endif return aSymSetMgrCopy.GetSymbolByName(rComboBox.GetText()); } -IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aOldSymbols, "Sm : falsches Argument"); +#endif SelectSymbol(aOldSymbols, aOldSymbols.GetText(), FALSE); return 0; } -IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aOldSymbolSets, "Sm : falsches Argument"); +#endif SelectSymbolSet(aOldSymbolSets, aOldSymbolSets.GetText(), FALSE); return 0; } @@ -1850,7 +1918,11 @@ IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) // nur Namen aus der Liste erlauben (ist hier eh immer der Fall) SelectStyle(aStyles.GetText(), TRUE); else + { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(0, "Sm : falsche ComboBox Argument"); +#endif + } pComboBox->SetSelection(aSelection); @@ -1860,16 +1932,18 @@ IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) } -IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, pListBox ) +IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pListBox == &aFonts, "Sm : falsches Argument"); +#endif SelectFont(aFonts.GetSelectEntry()); return 0; } -IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, pListBox ) +IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) { USHORT nPos = aFontsSubsetLB.GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nPos) @@ -1877,17 +1951,18 @@ IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, pListBox ) const Subset* pSubset = reinterpret_cast (aFontsSubsetLB.GetEntryData( nPos )); if (pSubset) { - sal_Unicode cFirst = pSubset->GetRangeMin(); - aCharsetDisplay.SelectCharacter( cFirst ); + aCharsetDisplay.SelectCharacter( pSubset->GetRangeMin() ); } } return 0; } -IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) +IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aStyles, "Sm : falsches Argument"); +#endif SelectStyle(aStyles.GetText()); return 0; @@ -1896,9 +1971,11 @@ IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, pComboBox ) IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) { - sal_Unicode cChar = aCharsetDisplay.GetSelectCharacter(); + sal_UCS4 cChar = aCharsetDisplay.GetSelectCharacter(); +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( pSubsetMap, "SubsetMap missing" ) +#endif if (pSubsetMap) { const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); @@ -1908,16 +1985,19 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) aFontsSubsetLB.SetNoSelection(); } - aSymbolDisplay.SetChar( cChar ); + // TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality + aSymbolDisplay.SetChar( sal::static_int_cast< sal_Unicode >(cChar) ); UpdateButtons(); return 0; } -IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) +IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aAddBtn, "Sm : falsches Argument"); DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); +#endif SmSymSet *pSymSet = GetSymbolSet(aSymbolSets); @@ -1929,11 +2009,14 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) FillSymbolSets(aOldSymbolSets, FALSE); FillSymbolSets(aSymbolSets, FALSE); } +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pSymSet, "Sm : NULL pointer"); +#endif // Symbol ins SymbolSet einfuegen + // TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(), - aCharsetDisplay.GetSelectCharacter(), + sal::static_int_cast< sal_Unicode >(aCharsetDisplay.GetSelectCharacter()), aSymbolSets.GetText()); pSymSet->AddSymbol(pSym); @@ -1951,14 +2034,18 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, pButton ) } -IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) +IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aChangeBtn, "Sm : falsches Argument"); DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); +#endif // finden des SymbolSets zum alten Symbol SmSymSet *pOldSymSet = GetSymbolSet(aOldSymbolSets); +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pOldSymSet, "Sm : NULL pointer"); +#endif // suchen des neuen SymbolSets SmSymSet *pNewSymSet = GetSymbolSet(aSymbolSets); @@ -1973,16 +2060,19 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) // das (alte) Symbol besorgen USHORT nSymbol = pOldSymSet->GetSymbolPos(aOldSymbols.GetText()); - DBG_ASSERT( SYMBOL_NONE != nSymbol, "symbol not found" ); SmSym *pSym = (SmSym *) &pOldSymSet->GetSymbol(nSymbol); +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( SYMBOL_NONE != nSymbol, "symbol not found" ); DBG_ASSERT(pSym, "Sm : NULL pointer"); +#endif // apply changes pSym->SetName( aSymbols.GetText() ); //! get font from symbol-display since charset-display does not keep //! the bold attribut. pSym->SetFace( aSymbolDisplay.GetFont() ); - pSym->SetCharacter( aCharsetDisplay.GetSelectCharacter() ); + // TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality + pSym->SetCharacter( sal::static_int_cast< sal_Unicode >(aCharsetDisplay.GetSelectCharacter()) ); // das SymbolSet wechseln wenn noetig if (pOldSymSet != pNewSymSet) @@ -1994,11 +2084,11 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) // update controls // // actualize symbol-lists in the dialog - String aOldSymbolName( pOrigSymbol->GetName() ); + String aTmpOldSymbolName( pOrigSymbol->GetName() ); aOldSymbols.SetText( String() ); - aOldSymbols.RemoveEntry( aOldSymbolName ); + aOldSymbols.RemoveEntry( aTmpOldSymbolName ); if (aSymbolSets.GetText() == aOldSymbolSets.GetText()) - aSymbols.RemoveEntry( aOldSymbolName ); + aSymbols.RemoveEntry( aTmpOldSymbolName ); // clear display for original symbol SetOrigSymbol(NULL, XubString()); } @@ -2013,10 +2103,12 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, pButton ) } -IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) +IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, EMPTYARG /*pButton*/ ) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aDeleteBtn, "Sm : falsches Argument"); DBG_ASSERT(aDeleteBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); +#endif if (pOrigSymbol) { @@ -2024,15 +2116,17 @@ IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) // // zugehoeriges SymbolSet finden SmSymSet *pSymSet = GetSymbolSet(aOldSymbolSets); - DBG_ASSERT(pSymSet, "Sm : NULL pointer"); // finden des Index - XubString aOldSymbolName (pOrigSymbol->GetName()); - USHORT nSymbolNo = pSymSet->GetSymbolPos(aOldSymbolName); - DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol"); + XubString aTmpOldSymbolName (pOrigSymbol->GetName()); + USHORT nSymbolNo = pSymSet->GetSymbolPos(aTmpOldSymbolName); // Bezuege auf das Symbols loeschen SetOrigSymbol(NULL, XubString()); // und weg mit dem Symbol pSymSet->DeleteSymbol(nSymbolNo); +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT(pSymSet, "Sm : NULL pointer"); + DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol"); +#endif //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren, //!! was er naemlich nicht tut, wenn in einem seiner SymbolSets geaendert/ @@ -2042,9 +2136,9 @@ IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, pButton ) // aktualisieren der Symboleintraege des Dialogs aOldSymbols.SetText(XubString()); - aOldSymbols.RemoveEntry(aOldSymbolName); + aOldSymbols.RemoveEntry(aTmpOldSymbolName); if (aSymbolSets.GetText() == aOldSymbolSets.GetText()) - aSymbols.RemoveEntry(aOldSymbolName); + aSymbols.RemoveEntry(aTmpOldSymbolName); } UpdateButtons(); @@ -2059,16 +2153,16 @@ void SmSymDefineDialog::UpdateButtons() bChange = FALSE, bDelete = FALSE, bEqual; - XubString aSymbolName (aSymbols.GetText()), - aSymbolSetName (aSymbolSets.GetText()); + XubString aTmpSymbolName (aSymbols.GetText()), + aTmpSymbolSetName (aSymbolSets.GetText()); - if (aSymbolName.Len() > 0 && aSymbolSetName.Len() > 0) + if (aTmpSymbolName.Len() > 0 && aTmpSymbolSetName.Len() > 0) { // alle Einstellungen gleich? //! (Font-, Style- und SymbolSet Name werden nicht case sensitiv verglichen) bEqual = pOrigSymbol - && aSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) - && aSymbolName.Equals(pOrigSymbol->GetName()) + && aTmpSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) + && aTmpSymbolName.Equals(pOrigSymbol->GetName()) && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii( pOrigSymbol->GetFace().GetName()) && aStyles.GetText().EqualsIgnoreCaseAscii( @@ -2076,7 +2170,7 @@ void SmSymDefineDialog::UpdateButtons() && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); // hinzufuegen nur wenn es noch kein Symbol desgleichen Namens gibt - bAdd = aSymSetMgrCopy.GetSymbolByName(aSymbolName) == NULL; + bAdd = aSymSetMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL; // loeschen nur wenn alle Einstellungen gleich sind bDelete = pOrigSymbol != NULL; @@ -2084,7 +2178,7 @@ void SmSymDefineDialog::UpdateButtons() // aendern wenn bei gleichem Namen mindestens eine Einstellung anders ist // oder wenn es noch kein Symbol des neuen Namens gibt (wuerde implizites // loeschen des bereits vorhandenen Symbols erfordern) - BOOL bEqualName = pOrigSymbol && aSymbolName == pOrigSymbol->GetName(); + BOOL bEqualName = pOrigSymbol && aTmpSymbolName == pOrigSymbol->GetName(); bChange = pOrigSymbol && (bEqualName && !bEqual || !bEqualName && bAdd); } @@ -2097,6 +2191,7 @@ void SmSymDefineDialog::UpdateButtons() SmSymDefineDialog::SmSymDefineDialog(Window * pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), +<<<<<<< dialog.cxx aOldSymbolText (this, SmResId(1)), aOldSymbols (this, SmResId(1)), aOldSymbolSetText (this, SmResId(2)), @@ -2125,8 +2220,38 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, aCancelBtn (this, SmResId(1)), aRightArrow (this, SmResId(1)), pFontList (NULL), +======= + aOldSymbolText (this, ResId(1)), + aOldSymbols (this, ResId(1)), + aOldSymbolSetText (this, ResId(2)), + aOldSymbolSets (this, ResId(2)), + aCharsetDisplay (this, ResId(1)), + aSymbolText (this, ResId(9)), + aSymbols (this, ResId(4)), + aSymbolSetText (this, ResId(10)), + aSymbolSets (this, ResId(5)), + aFontText (this, ResId(3)), + aFonts (this, ResId(1)), + aFontsSubsetFT (this, ResId( FT_FONTS_SUBSET )), + aFontsSubsetLB (this, ResId( LB_FONTS_SUBSET )), + aStyleText (this, ResId(4)), + aStyles (this, ResId(3)), + aOldSymbolName (this, ResId(7)), + aOldSymbolDisplay (this, ResId(3)), + aOldSymbolSetName (this, ResId(8)), + aSymbolName (this, ResId(5)), + aSymbolDisplay (this, ResId(2)), + aSymbolSetName (this, ResId(6)), + aOkBtn (this, ResId(1)), + aCancelBtn (this, ResId(1)), + aAddBtn (this, ResId(1)), + aChangeBtn (this, ResId(2)), + aDeleteBtn (this, ResId(3)), + aRightArrow (this, ResId(1)), + rSymSetMgr (rMgr), +>>>>>>> 1.35.20.6 pSubsetMap (NULL), - rSymSetMgr (rMgr) + pFontList (NULL) { if (bFreeRes) FreeResource(); @@ -2222,13 +2347,18 @@ short SmSymDefineDialog::Execute() // Dabei von hinten durch das array iterieren, da beim loeschen die // Elemente aufruecken. USHORT nSymbolSets = aSymSetMgrCopy.GetSymbolSetCount(); - for (int i = nSymbolSets - 1; i >= 0; i--) - if (aSymSetMgrCopy.GetSymbolSet(i)->GetCount() == 0) - aSymSetMgrCopy.DeleteSymbolSet(i); + for (USHORT i = 0; i < nSymbolSets; i++) + { + USHORT nIdx = nSymbolSets - 1 - i; + if (aSymSetMgrCopy.GetSymbolSet(nIdx)->GetCount() == 0) + aSymSetMgrCopy.DeleteSymbolSet(nIdx); + } + + rSymSetMgr = aSymSetMgrCopy; #ifdef DEBUG - USHORT nS = rSymSetMgr.GetSymbolSetCount(); +// USHORT nS = rSymSetMgr.GetSymbolSetCount(); #endif } @@ -2240,7 +2370,7 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr) { aSymSetMgrCopy = rMgr; #ifdef DEBUG - USHORT nS = aSymSetMgrCopy.GetSymbolSetCount(); +// USHORT nS = aSymSetMgrCopy.GetSymbolSetCount(); #endif // Das modified Flag der Kopie auf FALSE setzen, damit man spaeter damit @@ -2267,8 +2397,10 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr) BOOL SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName, BOOL bDeleteText) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, "Sm : falsche ComboBox"); +#endif // 'Normalisieren' des SymbolNamens (ohne leading und trailing Leerzeichen) XubString aNormName (rSymbolSetName); @@ -2303,10 +2435,10 @@ BOOL SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, // Symbol bzw keins zur Anzeige bringen if (bIsOld) { - XubString aOldSymbolName; + XubString aTmpOldSymbolName; if (aOldSymbols.GetEntryCount() > 0) - aOldSymbolName = aOldSymbols.GetEntry(0); - SelectSymbol(aOldSymbols, aOldSymbolName, TRUE); + aTmpOldSymbolName = aOldSymbols.GetEntry(0); + SelectSymbol(aOldSymbols, aTmpOldSymbolName, TRUE); } UpdateButtons(); @@ -2347,8 +2479,10 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName, BOOL bDeleteText) { +#if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, "Sm : falsche ComboBox"); +#endif // 'Normalisieren' des SymbolNamens (ohne Leerzeichen) XubString aNormName (rSymbolName); @@ -2396,13 +2530,13 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, { // bei Wechsel des alten Symbols nur vorhandene anzeigen sonst keins const SmSym *pOldSymbol = NULL; - XubString aOldSymbolSetName; + XubString aTMpOldSymbolSetName; if (nPos != COMBOBOX_ENTRY_NOTFOUND) { pOldSymbol = aSymSetMgrCopy.GetSymbolByName(aNormName); - aOldSymbolSetName = aOldSymbolSets.GetText(); + aTMpOldSymbolSetName = aOldSymbolSets.GetText(); } - SetOrigSymbol(pOldSymbol, aOldSymbolSetName); + SetOrigSymbol(pOldSymbol, aTMpOldSymbolSetName); } else aSymbolName.SetText(rComboBox.GetText()); -- cgit v1.2.3 From 57deee90ebc7d4cd3d25157fbc52adf961c6dffb Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Fri, 25 May 2007 11:34:55 +0000 Subject: INTEGRATION: CWS tl32 (1.35.20); FILE MERGED 2007/04/16 13:03:35 tl 1.35.20.6: #i69286# warning-free code 2007/01/31 10:06:22 tl 1.35.20.5: #i69286# casting sal_UCS4 to sal_Unicode for the time being 2006/12/20 12:17:02 tl 1.35.20.4: #i69286# warning-free code 2006/11/02 15:13:54 tl 1.35.20.3: #i69286# make starmath warning-free for unxsols4(.pro) 2006/11/01 13:10:05 tl 1.35.20.2: #i69286# make starmath warning-free for unxlngi6(.pro) 2006/10/30 10:35:13 tl 1.35.20.1: #i69286# make starmath warning-free --- starmath/source/dialog.cxx | 64 ++-------------------------------------------- 1 file changed, 2 insertions(+), 62 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b7391eeefd60..30cc43ef8c22 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.37 $ + * $Revision: 1.38 $ * - * last change: $Author: vg $ $Date: 2007-05-25 12:33:41 $ + * last change: $Author: vg $ $Date: 2007-05-25 12:34:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1000,23 +1000,6 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_DISTANCEDIALOG)), -<<<<<<< dialog.cxx - aFixedText1 (this, SmResId(1)), - aFixedText2 (this, SmResId(2)), - aFixedText3 (this, SmResId(3)), - aFixedText4 (this, SmResId(4)), - aMetricField1 (this, SmResId(1)), - aMetricField2 (this, SmResId(2)), - aMetricField3 (this, SmResId(3)), - aMetricField4 (this, SmResId(4)), - aOKButton1 (this, SmResId(1)), - aCancelButton1 (this, SmResId(1)), - aMenuButton (this, SmResId(1)), - aDefaultButton (this, SmResId(1)), - aCheckBox1 (this, SmResId(1)), - aBitmap (this, SmResId(1)), - aFixedLine (this, SmResId(1)) -======= aFixedText1 (this, ResId(1)), aMetricField1 (this, ResId(1)), aFixedText2 (this, ResId(2)), @@ -1032,7 +1015,6 @@ SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) aDefaultButton (this, ResId(1)), aBitmap (this, ResId(1)), aFixedLine (this, ResId(1)) ->>>>>>> 1.35.20.6 { for (USHORT i = 0; i < NOCATEGORIES; i++) Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); @@ -1598,16 +1580,6 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), -<<<<<<< dialog.cxx - aSymbolSetText (this, SmResId(1)), - aSymbolSets (this, SmResId(1)), - aSymbolSetDisplay (this, SmResId(1)), - aSymbolName (this, SmResId(2)), - aSymbolDisplay (this, SmResId(2)), - aCloseBtn (this, SmResId(3)), - aEditBtn (this, SmResId(1)), - aGetBtn (this, SmResId(2)), -======= aSymbolSetText (this, ResId(1)), aSymbolSets (this, ResId(1)), aSymbolSetDisplay (this, ResId(1)), @@ -1617,7 +1589,6 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, aCloseBtn (this, ResId(3)), aEditBtn (this, ResId(1)), rViewSh (rViewShell), ->>>>>>> 1.35.20.6 rSymSetMgr (rMgr), pFontListDev (pFntListDevice) { @@ -2191,36 +2162,6 @@ void SmSymDefineDialog::UpdateButtons() SmSymDefineDialog::SmSymDefineDialog(Window * pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), -<<<<<<< dialog.cxx - aOldSymbolText (this, SmResId(1)), - aOldSymbols (this, SmResId(1)), - aOldSymbolSetText (this, SmResId(2)), - aOldSymbolSets (this, SmResId(2)), - aCharsetDisplay (this, SmResId(1)), - aSymbolText (this, SmResId(9)), - aSymbols (this, SmResId(4)), - aSymbolSetText (this, SmResId(10)), - aSymbolSets (this, SmResId(5)), - aFontText (this, SmResId(3)), - aFonts (this, SmResId(1)), - aFontsSubsetFT (this, SmResId( FT_FONTS_SUBSET )), - aFontsSubsetLB (this, SmResId( LB_FONTS_SUBSET )), - aStyleText (this, SmResId(4)), - aStyles (this, SmResId(3)), - aOldSymbolName (this, SmResId(7)), - aOldSymbolDisplay (this, SmResId(3)), - aOldSymbolSetName (this, SmResId(8)), - aSymbolName (this, SmResId(5)), - aSymbolDisplay (this, SmResId(2)), - aSymbolSetName (this, SmResId(6)), - aAddBtn (this, SmResId(1)), - aChangeBtn (this, SmResId(2)), - aDeleteBtn (this, SmResId(3)), - aOkBtn (this, SmResId(1)), - aCancelBtn (this, SmResId(1)), - aRightArrow (this, SmResId(1)), - pFontList (NULL), -======= aOldSymbolText (this, ResId(1)), aOldSymbols (this, ResId(1)), aOldSymbolSetText (this, ResId(2)), @@ -2249,7 +2190,6 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, aDeleteBtn (this, ResId(3)), aRightArrow (this, ResId(1)), rSymSetMgr (rMgr), ->>>>>>> 1.35.20.6 pSubsetMap (NULL), pFontList (NULL) { -- cgit v1.2.3 From 672612996cae28b26a3a379e4e2e94b775d1b17a Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 31 May 2007 09:04:48 +0000 Subject: #i10000# ResId changed into SmResId. --- starmath/inc/smmod.hxx | 6 +-- starmath/source/dialog.cxx | 104 ++++++++++++++++++++++---------------------- starmath/source/toolbox.cxx | 8 ++-- 3 files changed, 59 insertions(+), 59 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index 2dcd0d0f2868..f5e51ce267dc 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -4,9 +4,9 @@ * * $RCSfile: smmod.hxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: vg $ $Date: 2007-05-25 12:33:10 $ + * last change: $Author: rt $ $Date: 2007-05-31 10:02:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -90,7 +90,7 @@ class SmNamesArray : public Resource public: SmNamesArray( LanguageType nLang, int nRID ) : Resource( SmResId(RID_LOCALIZED_NAMES) ), - aNamesAry (ResId(nRID)), + aNamesAry (SmResId(nRID)), nLanguage (nLang) { FreeResource(); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 30cc43ef8c22..e361b659bcdf 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.38 $ + * $Revision: 1.39 $ * - * last change: $Author: vg $ $Date: 2007-05-25 12:34:55 $ + * last change: $Author: rt $ $Date: 2007-05-31 10:03:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1000,21 +1000,21 @@ void SmDistanceDialog::SetCategory(USHORT nCategory) SmDistanceDialog::SmDistanceDialog(Window *pParent, BOOL bFreeRes) : ModalDialog(pParent, SmResId(RID_DISTANCEDIALOG)), - aFixedText1 (this, ResId(1)), - aMetricField1 (this, ResId(1)), - aFixedText2 (this, ResId(2)), - aMetricField2 (this, ResId(2)), - aFixedText3 (this, ResId(3)), - aMetricField3 (this, ResId(3)), - aCheckBox1 (this, ResId(1)), - aFixedText4 (this, ResId(4)), - aMetricField4 (this, ResId(4)), - aOKButton1 (this, ResId(1)), - aCancelButton1 (this, ResId(1)), - aMenuButton (this, ResId(1)), - aDefaultButton (this, ResId(1)), - aBitmap (this, ResId(1)), - aFixedLine (this, ResId(1)) + aFixedText1 (this, SmResId(1)), + aMetricField1 (this, SmResId(1)), + aFixedText2 (this, SmResId(2)), + aMetricField2 (this, SmResId(2)), + aFixedText3 (this, SmResId(3)), + aMetricField3 (this, SmResId(3)), + aCheckBox1 (this, SmResId(1)), + aFixedText4 (this, SmResId(4)), + aMetricField4 (this, SmResId(4)), + aOKButton1 (this, SmResId(1)), + aCancelButton1 (this, SmResId(1)), + aMenuButton (this, SmResId(1)), + aDefaultButton (this, SmResId(1)), + aBitmap (this, SmResId(1)), + aFixedLine (this, SmResId(1)) { for (USHORT i = 0; i < NOCATEGORIES; i++) Categories[i] = new SmCategoryDesc(SmResId(i + 1), i); @@ -1580,14 +1580,14 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton ) SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)), - aSymbolSetText (this, ResId(1)), - aSymbolSets (this, ResId(1)), - aSymbolSetDisplay (this, ResId(1)), - aSymbolName (this, ResId(2)), - aSymbolDisplay (this, ResId(2)), - aGetBtn (this, ResId(2)), - aCloseBtn (this, ResId(3)), - aEditBtn (this, ResId(1)), + aSymbolSetText (this, SmResId(1)), + aSymbolSets (this, SmResId(1)), + aSymbolSetDisplay (this, SmResId(1)), + aSymbolName (this, SmResId(2)), + aSymbolDisplay (this, SmResId(2)), + aGetBtn (this, SmResId(2)), + aCloseBtn (this, SmResId(3)), + aEditBtn (this, SmResId(1)), rViewSh (rViewShell), rSymSetMgr (rMgr), pFontListDev (pFntListDevice) @@ -2162,33 +2162,33 @@ void SmSymDefineDialog::UpdateButtons() SmSymDefineDialog::SmSymDefineDialog(Window * pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) : ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)), - aOldSymbolText (this, ResId(1)), - aOldSymbols (this, ResId(1)), - aOldSymbolSetText (this, ResId(2)), - aOldSymbolSets (this, ResId(2)), - aCharsetDisplay (this, ResId(1)), - aSymbolText (this, ResId(9)), - aSymbols (this, ResId(4)), - aSymbolSetText (this, ResId(10)), - aSymbolSets (this, ResId(5)), - aFontText (this, ResId(3)), - aFonts (this, ResId(1)), - aFontsSubsetFT (this, ResId( FT_FONTS_SUBSET )), - aFontsSubsetLB (this, ResId( LB_FONTS_SUBSET )), - aStyleText (this, ResId(4)), - aStyles (this, ResId(3)), - aOldSymbolName (this, ResId(7)), - aOldSymbolDisplay (this, ResId(3)), - aOldSymbolSetName (this, ResId(8)), - aSymbolName (this, ResId(5)), - aSymbolDisplay (this, ResId(2)), - aSymbolSetName (this, ResId(6)), - aOkBtn (this, ResId(1)), - aCancelBtn (this, ResId(1)), - aAddBtn (this, ResId(1)), - aChangeBtn (this, ResId(2)), - aDeleteBtn (this, ResId(3)), - aRightArrow (this, ResId(1)), + aOldSymbolText (this, SmResId(1)), + aOldSymbols (this, SmResId(1)), + aOldSymbolSetText (this, SmResId(2)), + aOldSymbolSets (this, SmResId(2)), + aCharsetDisplay (this, SmResId(1)), + aSymbolText (this, SmResId(9)), + aSymbols (this, SmResId(4)), + aSymbolSetText (this, SmResId(10)), + aSymbolSets (this, SmResId(5)), + aFontText (this, SmResId(3)), + aFonts (this, SmResId(1)), + aFontsSubsetFT (this, SmResId( FT_FONTS_SUBSET )), + aFontsSubsetLB (this, SmResId( LB_FONTS_SUBSET )), + aStyleText (this, SmResId(4)), + aStyles (this, SmResId(3)), + aOldSymbolName (this, SmResId(7)), + aOldSymbolDisplay (this, SmResId(3)), + aOldSymbolSetName (this, SmResId(8)), + aSymbolName (this, SmResId(5)), + aSymbolDisplay (this, SmResId(2)), + aSymbolSetName (this, SmResId(6)), + aOkBtn (this, SmResId(1)), + aCancelBtn (this, SmResId(1)), + aAddBtn (this, SmResId(1)), + aChangeBtn (this, SmResId(2)), + aDeleteBtn (this, SmResId(3)), + aRightArrow (this, SmResId(1)), rSymSetMgr (rMgr), pSubsetMap (NULL), pFontList (NULL) diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx index b17cd54a2038..c35bc7b38d5a 100644 --- a/starmath/source/toolbox.cxx +++ b/starmath/source/toolbox.cxx @@ -4,9 +4,9 @@ * * $RCSfile: toolbox.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: vg $ $Date: 2007-05-25 12:35:48 $ + * last change: $Author: rt $ $Date: 2007-05-31 10:04:48 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -163,8 +163,8 @@ SmToolBoxWindow::SmToolBoxWindow(SfxBindings *pTmpBindings, SfxChildWindow *pChildWindow, Window *pParent) : SfxFloatingWindow(pTmpBindings, pChildWindow, pParent, SmResId(RID_TOOLBOXWINDOW)), - aToolBoxCat(this, ResId(NUM_TBX_CATEGORIES + 1)), - aToolBoxCat_Delim(this, ResId( FL_TOOLBOX_CAT_DELIM )) + aToolBoxCat(this, SmResId(NUM_TBX_CATEGORIES + 1)), + aToolBoxCat_Delim(this, SmResId( FL_TOOLBOX_CAT_DELIM )) { RTL_LOGFILE_CONTEXT( aLog, "starmath: SmToolBoxWindow::SmToolBoxWindow" ); -- cgit v1.2.3 From 099a952ceebd08dda71cf34d003c66075b82bbe0 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Fri, 3 Aug 2007 12:53:58 +0000 Subject: INTEGRATION: CWS hcicons (1.35.40); FILE MERGED 2007/07/01 14:05:03 fs 1.35.40.2: RESYNC: (1.35-1.39); FILE MERGED 2007/05/25 11:21:54 tl 1.35.40.1: #146858# adding hi-contrast image for right arrow --- starmath/source/dialog.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index e361b659bcdf..eafa1c9acdf2 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: rt $ $Date: 2007-05-31 10:03:40 $ + * last change: $Author: hr $ $Date: 2007-08-03 13:53:58 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -2189,6 +2189,8 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent, aChangeBtn (this, SmResId(2)), aDeleteBtn (this, SmResId(3)), aRightArrow (this, SmResId(1)), + aRigthArrow_Im (SmResId(1)), + aRigthArrow_Im_HC (SmResId(2)), // hi-contrast version rSymSetMgr (rMgr), pSubsetMap (NULL), pFontList (NULL) @@ -2239,7 +2241,6 @@ SmSymDefineDialog::~SmSymDefineDialog() delete pOrigSymbol; } - void SmSymDefineDialog::InitColor_Impl() { #if OSL_DEBUG_LEVEL > 1 @@ -2247,7 +2248,8 @@ void SmSymDefineDialog::InitColor_Impl() #endif ColorData nBgCol = COL_WHITE, nTxtCol = COL_BLACK; - if (GetDisplayBackground().GetColor().IsDark()) + BOOL bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0; + if (bHighContrast) { const StyleSettings &rS = GetSettings().GetStyleSettings(); nBgCol = rS.GetFieldColor().GetColor(); @@ -2263,6 +2265,9 @@ void SmSymDefineDialog::InitColor_Impl() aOldSymbolDisplay.SetTextColor( aTxtColor ); aSymbolDisplay .SetBackground( aWall ); aSymbolDisplay .SetTextColor( aTxtColor ); + + const Image &rArrowRight = bHighContrast ? aRigthArrow_Im_HC : aRigthArrow_Im; + aRightArrow.SetImage( rArrowRight ); } -- cgit v1.2.3 From 5ad81b0c0b0a32f4a98a042d1600d38ff6e476de Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Fri, 9 Nov 2007 09:52:52 +0000 Subject: INTEGRATION: CWS tl45 (1.40.12); FILE MERGED 2007/10/31 11:28:53 tl 1.40.12.2: warning-free code fixes for non-pro build 2007/08/30 09:53:47 tl 1.40.12.1: #i57667# remove class SmAboutDialog --- starmath/source/dialog.cxx | 72 +++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 42 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index eafa1c9acdf2..03e8a4020271 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.40 $ + * $Revision: 1.41 $ * - * last change: $Author: hr $ $Date: 2007-08-03 13:53:58 $ + * last change: $Author: rt $ $Date: 2007-11-09 10:52:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -227,32 +227,6 @@ void SetFontStyle(const XubString &rStyleName, Font &rFont) /**************************************************************************/ -SmAboutDialog::SmAboutDialog(Window *pParent, BOOL bFreeRes) : - ModalDialog (pParent, SmResId(RID_DEFAULTABOUT)), - aFixedText1 (this, SmResId(1)), - aFixedText2 (this, SmResId(2)), - aFixedText3 (this, SmResId(3)), - aFixedText4 (this, SmResId(4)), - aFixedText5 (this, SmResId(5)), - aFixedText6 (this, SmResId(6)), - aReleaseText (this, SmResId(7)), - aFixedBitmap1(this, SmResId(1)), - aOKButton1 (this, SmResId(1)) -{ - if (bFreeRes) - FreeResource(); - -#ifndef PRODUCT - aReleaseText.Show(); -#else - aReleaseText.Hide(); -#endif - -} - -/**************************************************************************/ - - IMPL_LINK_INLINE_START( SmPrintOptionsTabPage, SizeButtonClickHdl, Button *, EMPTYARG/*pButton*/ ) { aZoom.Enable(aSizeZoomed.IsChecked()); @@ -1471,8 +1445,9 @@ void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText) } -IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) +IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, EMPTYARG pListBox ) { + (void) pListBox; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pListBox == &aSymbolSets, "Sm : falsches Argument"); #endif @@ -1482,8 +1457,9 @@ IMPL_LINK( SmSymbolDialog, SymbolSetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ } -IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, EMPTYARG /*pShowSymbolSet*/ ) +IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, EMPTYARG pShowSymbolSet ) { + (void) pShowSymbolSet; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); #endif @@ -1492,8 +1468,9 @@ IMPL_LINK( SmSymbolDialog, SymbolChangeHdl, SmShowSymbolSet *, EMPTYARG /*pShowS return 0; } -IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aEditBtn, "Sm : falsches Argument"); #endif @@ -1532,8 +1509,9 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG /*pButton*/ ) } -IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, EMPTYARG /*pShowSymbolSet*/ ) +IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, EMPTYARG pShowSymbolSet ) { + (void) pShowSymbolSet; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pShowSymbolSet == &aSymbolSetDisplay, "Sm : falsches Argument"); #endif @@ -1544,8 +1522,9 @@ IMPL_LINK( SmSymbolDialog, SymbolDblClickHdl, SmShowSymbolSet *, EMPTYARG /*pSho } -IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aGetBtn, "Sm : falscher Button"); #endif @@ -1565,8 +1544,9 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG /*pButton*/ ) } -IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK_INLINE_START( SmSymbolDialog, CloseClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aCloseBtn, "Sm : falscher Button"); #endif @@ -1850,8 +1830,9 @@ SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) } -IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) +IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, EMPTYARG pComboBox ) { + (void) pComboBox; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aOldSymbols, "Sm : falsches Argument"); #endif @@ -1860,8 +1841,9 @@ IMPL_LINK( SmSymDefineDialog, OldSymbolChangeHdl, ComboBox *, EMPTYARG /*pComboB } -IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) +IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, EMPTYARG pComboBox ) { + (void) pComboBox; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aOldSymbolSets, "Sm : falsches Argument"); #endif @@ -1903,8 +1885,9 @@ IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) } -IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) +IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, EMPTYARG pListBox ) { + (void) pListBox; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pListBox == &aFonts, "Sm : falsches Argument"); #endif @@ -1914,8 +1897,9 @@ IMPL_LINK( SmSymDefineDialog, FontChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) } -IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ ) +IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, EMPTYARG pListBox ) { + (void) pListBox; USHORT nPos = aFontsSubsetLB.GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nPos) { @@ -1929,8 +1913,9 @@ IMPL_LINK( SmSymDefineDialog, SubsetChangeHdl, ListBox *, EMPTYARG /*pListBox*/ } -IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, EMPTYARG /*pComboBox*/ ) +IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, EMPTYARG pComboBox ) { + (void) pComboBox; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pComboBox == &aStyles, "Sm : falsches Argument"); #endif @@ -1963,8 +1948,9 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) } -IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aAddBtn, "Sm : falsches Argument"); DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); @@ -2005,8 +1991,9 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG /*pButton*/ ) } -IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aChangeBtn, "Sm : falsches Argument"); DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); @@ -2074,8 +2061,9 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG /*pButton*/ ) } -IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, EMPTYARG /*pButton*/ ) +IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, EMPTYARG pButton ) { + (void) pButton; #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT(pButton == &aDeleteBtn, "Sm : falsches Argument"); DBG_ASSERT(aDeleteBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??"); -- cgit v1.2.3 From 0d5a055994c52595e93a9e039fdce73e8b94f02d Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 26 Feb 2008 13:43:42 +0000 Subject: INTEGRATION: CWS custommeta (1.41.12); FILE MERGED 2008/01/24 09:33:17 mst 1.41.12.1: - starmath/source/dialog.cxx: + fix debug-only warning --- starmath/source/dialog.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 03e8a4020271..2b8cbaf063e8 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialog.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: rt $ $Date: 2007-11-09 10:52:52 $ + * last change: $Author: obo $ $Date: 2008-02-26 14:43:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -851,7 +851,7 @@ void SmDistanceDialog::SetHelpId(MetricField &rField, ULONG nHelpId) void SmDistanceDialog::SetCategory(USHORT nCategory) { #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT(0 <= nCategory && nCategory < NOCATEGORIES, + DBG_ASSERT(/*0 <= nCategory &&*/ nCategory < NOCATEGORIES, "Sm: falsche Kategorienummer in SmDistanceDialog"); #endif -- cgit v1.2.3 From 52da30c3a495a1269eef78b26ecfd9b06f371691 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 10 Apr 2008 11:42:10 +0000 Subject: INTEGRATION: CWS changefileheader (1.42.12); FILE MERGED 2008/04/01 15:41:57 thb 1.42.12.3: #i85898# Stripping all external header guards 2008/04/01 12:41:38 thb 1.42.12.2: #i85898# Stripping all external header guards 2008/03/31 16:29:36 rt 1.42.12.1: #i87441# Change license header to LPGL v3. --- starmath/source/dialog.cxx | 92 +++++++++------------------------------------- 1 file changed, 18 insertions(+), 74 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 2b8cbaf063e8..834657d6cdec 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1,35 +1,30 @@ /************************************************************************* * - * OpenOffice.org - a multi-platform office productivity suite + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * $RCSfile: dialog.cxx,v $ + * Copyright 2008 by Sun Microsystems, Inc. * - * $Revision: 1.42 $ + * OpenOffice.org - a multi-platform office productivity suite * - * last change: $Author: obo $ $Date: 2008-02-26 14:43:42 $ + * $RCSfile: dialog.cxx,v $ + * $Revision: 1.43 $ * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. + * 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. * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA + * 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). * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. * ************************************************************************/ @@ -38,88 +33,37 @@ #define SMDLL 1 - -#ifndef _TOOLS_RCID_H #include "tools/rcid.h" -#endif - -#ifndef _SFXENUMITEM_HXX //autogen #include -#endif -#ifndef _SFXINTITEM_HXX //autogen #include -#endif -#ifndef _SFXSTRITEM_HXX //autogen #include -#endif -#ifndef _SFXAPP_HXX //autogen #include -#endif -#ifndef _SV_MSGBOX_HXX //autogen #include -#endif -#ifndef _CTRLTOOL_HXX //autogen #include -#endif -#ifndef _SFX_PRINTER_HXX #include -#endif -#ifndef _SV_SOUND_HXX //autogen #include -#endif -#ifndef _SV_SNDSTYLE_HXX //autogen #include -#endif -#ifndef _SV_WAITOBJ_HXX #include -#endif -#ifndef _SV_SETTINGS_HXX #include -#endif -#ifndef _SV_WALL_HXX #include -#endif -#ifndef _SFXDISPATCH_HXX //autogen #include -#endif -#ifndef _SFX_HRC //autogen #include -#endif -#ifndef _STRING_HXX //autogen #include -#endif -#ifndef _TOOLS_DEBUG_HXX //autogen #include -#endif -#ifndef _SVX_SUBSETMAP_HXX #include -#endif -#ifndef CONFIG_HXX #include "config.hxx" -#endif -#ifndef DIALOG_HXX #include "dialog.hxx" -#endif #ifndef _STARMATH_HRC #include "starmath.hrc" #endif #include "dialog.hrc" - -#ifndef _SMMOD_HXX #include "smmod.hxx" -#endif -#ifndef SYMBOL_HXX #include "symbol.hxx" -#endif -#ifndef VIEW_HXX #include "view.hxx" -#endif -#ifndef DOCUMENT_HXX #include "document.hxx" -#endif //////////////////////////////////////// // -- cgit v1.2.3 From 2fa12db3d224643d0c2dbf8dd3b60e0021e27b7a Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Tue, 22 Jul 2008 06:14:15 +0000 Subject: INTEGRATION: CWS pba11y01 (1.43.30); FILE MERGED 2008/07/14 07:36:03 tl 1.43.30.1: #i91480# fix for font format list config entry --- starmath/source/dialog.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 834657d6cdec..6644d0a8ce49 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dialog.cxx,v $ - * $Revision: 1.43 $ + * $Revision: 1.44 $ * * This file is part of OpenOffice.org. * @@ -539,7 +539,7 @@ IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, EMPTY SmModule *pp = SM_MOD1(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); - pp->GetConfig()->SetStandardFormat( aFmt ); + pp->GetConfig()->SetStandardFormat( aFmt, TRUE ); } delete pQueryBox; -- cgit v1.2.3 From ec7b0d30a194a6a3bfa95205bd24a4ce222ee0c1 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 11 Dec 2008 07:05:03 +0000 Subject: CWS-TOOLING: integrate CWS cmcfixes51 2008-12-08 10:12:55 +0100 cmc r264975 : #i96203# protect with ifdefs to avoid unused symbol on mac 2008-12-05 12:23:47 +0100 cmc r264898 : CWS-TOOLING: rebase CWS cmcfixes51 to trunk@264807 (milestone: DEV300:m37) 2008-12-01 14:45:17 +0100 cmc r264606 : #i76655# ehlos apparently required 2008-11-28 17:49:30 +0100 cmc r264567 : #i96655# remove newly unused method 2008-11-28 10:41:28 +0100 cmc r264531 : #i96647# better ppc-bridges flushCode impl 2008-11-27 12:58:40 +0100 cmc r264478 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:32:49 +0100 cmc r264476 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:26:02 +0100 cmc r264475 : #i96655# redundant old table export helpers 2008-11-27 11:49:06 +0100 cmc r264473 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:38:35 +0100 cmc r264471 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:14:21 +0100 cmc r264467 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:06:22 +0100 cmc r264464 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:58:18 +0100 cmc r264462 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:41:44 +0100 cmc r264461 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:19:24 +0100 cmc r264460 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:13:39 +0100 cmc r264459 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:06:14 +0100 cmc r264458 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:59:54 +0100 cmc r264457 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:52:51 +0100 cmc r264456 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:48:26 +0100 cmc r264454 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:40:20 +0100 cmc r264452 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:35:26 +0100 cmc r264451 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:31:00 +0100 cmc r264450 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:24:08 +0100 cmc r264449 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:26:15 +0100 cmc r264443 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:21:01 +0100 cmc r264442 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:09:40 +0100 cmc r264441 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:51:56 +0100 cmc r264440 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:49:09 +0100 cmc r264439 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:09:54 +0100 cmc r264432 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:07:40 +0100 cmc r264431 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:28:02 +0100 cmc r264429 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:27:39 +0100 cmc r264428 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:18:36 +0100 cmc r264426 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 16:22:16 +0100 cmc r264415 : #i96624# make implicit braces and brackets explicit to avoid warnings 2008-11-26 16:00:23 +0100 cmc r264409 : #i90426# remove warnings from svtools 2008-11-26 15:59:17 +0100 cmc r264408 : #i90426# remove warnings 2008-11-26 15:47:32 +0100 cmc r264404 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:46:57 +0100 cmc r264394 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:19:50 +0100 cmc r264387 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:15:26 +0100 cmc r264386 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:11:26 +0100 cmc r264384 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:44:23 +0100 cmc r264380 : #i96084# comfirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:12:24 +0100 cmc r264372 : #i96604# silence new warnings 2008-11-26 12:35:02 +0100 cmc r264369 : #i96203# make qstarter work in 3-layer land 2008-11-26 12:33:04 +0100 cmc r264368 : #i96170# ensure gtypes are up and running --- starmath/source/dialog.cxx | 2 +- starmath/source/document.cxx | 12 ++++++++++-- starmath/source/mathml.cxx | 2 ++ starmath/source/node.cxx | 16 ++++++++++++---- sw/source/filter/ww8/wrtw8nds.cxx | 3 ++- sw/source/filter/ww8/wrtww8.hxx | 3 ++- sw/source/filter/ww8/ww8atr.cxx | 10 ---------- 7 files changed, 29 insertions(+), 19 deletions(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 6644d0a8ce49..cdf6ef8958ca 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2082,7 +2082,7 @@ void SmSymDefineDialog::UpdateButtons() // oder wenn es noch kein Symbol des neuen Namens gibt (wuerde implizites // loeschen des bereits vorhandenen Symbols erfordern) BOOL bEqualName = pOrigSymbol && aTmpSymbolName == pOrigSymbol->GetName(); - bChange = pOrigSymbol && (bEqualName && !bEqual || !bEqualName && bAdd); + bChange = pOrigSymbol && ( (bEqualName && !bEqual) || (!bEqualName && bAdd) ); } aAddBtn .Enable(bAdd); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 1ed5cdab3fd7..4a4bd42c6097 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -822,8 +822,16 @@ BOOL SmDocShell::Load( SfxMedium& rMedium ) { uno::Reference < embed::XStorage > xStorage = pMedium->GetStorage(); uno::Reference < container::XNameAccess > xAccess (xStorage, uno::UNO_QUERY); - if ( xAccess->hasByName( C2S( "content.xml" ) ) && xStorage->isStreamElement( C2S( "content.xml" ) ) || - xAccess->hasByName( C2S( "Content.xml" ) ) && xStorage->isStreamElement( C2S( "Content.xml" ) ) ) + if ( + ( + xAccess->hasByName( C2S( "content.xml" ) ) && + xStorage->isStreamElement( C2S( "content.xml" ) ) + ) || + ( + xAccess->hasByName( C2S( "Content.xml" ) ) && + xStorage->isStreamElement( C2S( "Content.xml" ) ) + ) + ) { // is this a fabulous math package ? Reference xModel(GetModel()); diff --git a/starmath/source/mathml.cxx b/starmath/source/mathml.cxx index f6fbd1ed251c..dc3e153d3613 100644 --- a/starmath/source/mathml.cxx +++ b/starmath/source/mathml.cxx @@ -1323,6 +1323,7 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference< rContext.GetSmImport().GetMM100UnitConverter(). setXMLMeasureUnit(MAP_POINT); if (-1 == sValue.indexOf(GetXMLToken(XML_UNIT_PT))) + { if (-1 == sValue.indexOf('%')) nFontSize=0.0; else @@ -1330,6 +1331,7 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference< rContext.GetSmImport().GetMM100UnitConverter(). setXMLMeasureUnit(MAP_RELATIVE); } + } break; case XML_TOK_FONTFAMILY: sFontFamily = sValue; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index fa5a27920cc2..114d6437bb62 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -213,9 +213,13 @@ void SmNode::SetColor(const Color& rColor) void SmNode::SetAttribut(USHORT nAttrib) { - if ( nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD) - || nAttrib == ATTR_ITALIC && !(Flags() & FLG_ITALIC)) + if ( + (nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD)) || + (nAttrib == ATTR_ITALIC && !(Flags() & FLG_ITALIC)) + ) + { nAttributes |= nAttrib; + } SmNode *pNode; USHORT nSize = GetNumSubNodes(); @@ -227,9 +231,13 @@ void SmNode::SetAttribut(USHORT nAttrib) void SmNode::ClearAttribut(USHORT nAttrib) { - if ( nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD) - || nAttrib == ATTR_ITALIC && !(Flags() & FLG_ITALIC)) + if ( + (nAttrib == ATTR_BOLD && !(Flags() & FLG_BOLD)) || + (nAttrib == ATTR_ITALIC && !(Flags() & FLG_ITALIC)) + ) + { nAttributes &= ~nAttrib; + } SmNode *pNode; USHORT nSize = GetNumSubNodes(); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 7024c967c87d..5decec3d7a12 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2104,6 +2104,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) } +#if 0 /* */ USHORT SwWW8Writer::StartTableFromFrmFmt(WW8Bytes &rAt, const SwFrmFmt *pFmt, @@ -2222,7 +2223,7 @@ bool RowContainsProblematicGraphic(const SwWriteTableCellPtr *pRow, } return bHasGraphic; } - +#endif //--------------------------------------------------------------------------- // Tabellen //--------------------------------------------------------------------------- diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 4669beef0663..1db96f768dde 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -594,10 +594,11 @@ public: void WriteText(); void WriteCR(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo = ww8::WW8TableNodeInfo::Pointer_t()); void WriteChar( sal_Unicode c ); - void WriteCellEnd(); void WriteRowEnd(sal_uInt32 nDepth = 1); +#if 0 USHORT StartTableFromFrmFmt(WW8Bytes &rAt, const SwFrmFmt *pFmt, SwTwips &rPageSize); +#endif void OutSwString(const String&, xub_StrLen nStt, xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index b14821161408..5e321f217da5 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3449,16 +3449,6 @@ ULONG SwWW8Writer::ReplaceCr( BYTE nChar ) return nRetPos; } -void SwWW8Writer::WriteCellEnd() -{ - //Technically in a word document this is a different value for a - //cell without a graphic. But it doesn't seem to make a difference - ULONG nOffset = ReplaceCr( (BYTE)0x07 ); - ASSERT(nOffset, "Eek!, no para end mark to replace with row end mark"); - if (nOffset) - pMagicTable->Append(Fc2Cp(nOffset),0x122); -} - void SwWW8Writer::WriteRowEnd(sal_uInt32 nDepth) { if (nDepth == 1) -- cgit v1.2.3 From 7977c2731d83b98d9a281f5ca6d2752a226e41b5 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 16 Feb 2009 08:33:19 +0000 Subject: CWS-TOOLING: integrate CWS macmiscfixes 2009-01-26 07:58:26 +0100 fheckl r266898 : 97394 add a small memory leak fix 2009-01-24 20:56:18 +0100 ericb r266885 : #i95688# better fix suggested by rvojta 2009-01-24 17:13:37 +0100 rakeshpandit r266882 : #i98428# Fixed a missing ';'. 2009-01-24 00:25:43 +0100 ericb r266859 : #i95688# a try to fix the send active document including when the name contains space 2009-01-24 00:23:59 +0100 ericb r266858 : #i97394# fix aliases (disabled) in save dialog. Patch provided by Robert Vojta --- starmath/source/dialog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'starmath/source/dialog.cxx') diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index cdf6ef8958ca..20af2f38b3ee 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1874,7 +1874,7 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG ) sal_UCS4 cChar = aCharsetDisplay.GetSelectCharacter(); #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( pSubsetMap, "SubsetMap missing" ) + DBG_ASSERT( pSubsetMap, "SubsetMap missing" ); #endif if (pSubsetMap) { -- cgit v1.2.3