Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
889d495c
Kaydet (Commit)
889d495c
authored
Agu 03, 2010
tarafından
Thomas Lange [tl]
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cws tl82: #i74049# math symbols should be able to handle 20 bit Unicode characters (surrogates)
üst
3ed4c287
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
62 deletions
+86
-62
dialog.hxx
starmath/inc/dialog.hxx
+2
-4
symbol.hxx
starmath/inc/symbol.hxx
+4
-4
utility.hxx
starmath/inc/utility.hxx
+0
-4
cfgitem.cxx
starmath/source/cfgitem.cxx
+3
-3
dialog.cxx
starmath/source/dialog.cxx
+51
-34
node.cxx
starmath/source/node.cxx
+16
-5
smres.src
starmath/source/smres.src
+7
-7
symbol.cxx
starmath/source/symbol.cxx
+1
-1
utility.cxx
starmath/source/utility.cxx
+2
-0
No files found.
starmath/inc/dialog.hxx
Dosyayı görüntüle @
889d495c
...
...
@@ -30,9 +30,7 @@
#include <vcl/image.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
#endif
#include <vcl/image.hxx>
#include <sfx2/tabdlg.hxx>
#include <vcl/combobox.hxx>
...
...
@@ -403,8 +401,8 @@ public:
{
}
void
Set
Char
(
xub_Unicode
aChar
);
void
Set
Font
(
const
Font
&
rFont
);
void
Set
Symbol
(
const
SmSym
*
pSym
);
void
Set
Symbol
(
sal_UCS4
cChar
,
const
Font
&
rFont
);
};
////////////////////////////////////////////////////////////////////////////////
...
...
starmath/inc/symbol.hxx
Dosyayı görüntüle @
889d495c
...
...
@@ -79,24 +79,24 @@ class SmSym
String
m_aName
;
String
m_aExportName
;
String
m_aSetName
;
sal_U
nicode
m_cChar
;
sal_U
CS4
m_cChar
;
BOOL
m_bPredefined
;
BOOL
m_bDocSymbol
;
public
:
SmSym
();
SmSym
(
const
String
&
rName
,
const
Font
&
rFont
,
sal_U
nicode
cChar
,
SmSym
(
const
String
&
rName
,
const
Font
&
rFont
,
sal_U
CS4
cChar
,
const
String
&
rSet
,
BOOL
bIsPredefined
=
FALSE
);
SmSym
(
const
SmSym
&
rSymbol
);
SmSym
&
operator
=
(
const
SmSym
&
rSymbol
);
const
Font
&
GetFace
()
const
{
return
m_aFace
;
}
sal_U
nicode
GetCharacter
()
const
{
return
m_cChar
;
}
sal_U
CS4
GetCharacter
()
const
{
return
m_cChar
;
}
const
String
&
GetName
()
const
{
return
m_aName
;
}
void
SetFace
(
const
Font
&
rFont
)
{
m_aFace
=
rFont
;
}
void
SetCharacter
(
sal_U
nicode
cChar
)
{
m_cChar
=
cChar
;
}
void
SetCharacter
(
sal_U
CS4
cChar
)
{
m_cChar
=
cChar
;
}
//! since the symbol name is also used as key in the map it should not be possible to change the name
//! because ten the key would not be the same as its supposed copy here
...
...
starmath/inc/utility.hxx
Dosyayı görüntüle @
889d495c
...
...
@@ -42,10 +42,6 @@ class String;
#define C2S(cChar) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar))
/////////////////////////////////////////////////////////////////
const
ByteString
ExportString
(
const
String
&
rString
);
const
String
ImportString
(
const
ByteString
&
rByteString
);
/////////////////////////////////////////////////////////////////
...
...
starmath/source/cfgitem.cxx
Dosyayı görüntüle @
889d495c
...
...
@@ -490,7 +490,7 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol,
{
const
Any
*
pValue
=
aValues
.
getConstArray
();
Font
aFont
;
sal_U
nicode
cChar
=
'\0'
;
sal_U
CS4
cChar
=
'\0'
;
String
aSet
;
BOOL
bPredefined
=
FALSE
;
...
...
@@ -500,7 +500,7 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol,
BOOL
bOK
=
TRUE
;
if
(
pValue
->
hasValue
()
&&
(
*
pValue
>>=
nTmp32
))
cChar
=
(
sal_Unicode
)
nTmp32
;
cChar
=
static_cast
<
sal_UCS4
>
(
nTmp32
)
;
else
bOK
=
FALSE
;
++
pValue
;
...
...
@@ -624,7 +624,7 @@ void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols )
// Char
pVal
->
Name
=
aNodeNameDelim
;
pVal
->
Name
+=
*
pName
++
;
pVal
->
Value
<<=
(
INT32
)
rSymbol
.
GetCharacter
(
);
pVal
->
Value
<<=
static_cast
<
sal_UCS4
>
(
rSymbol
.
GetCharacter
()
);
pVal
++
;
// Set
pVal
->
Name
=
aNodeNameDelim
;
...
...
starmath/source/dialog.cxx
100644 → 100755
Dosyayı görüntüle @
889d495c
...
...
@@ -50,17 +50,18 @@
#include <svx/ucsubset.hxx>
#include "config.hxx"
#include "dialog.hxx"
#ifndef _STARMATH_HRC
#include "starmath.hrc"
#endif
#include "config.hxx"
#include "dialog.hrc"
#include "smmod.hxx"
#include "symbol.hxx"
#include "view.hxx"
#include "document.hxx"
#include "unomodel.hxx"
using
::
rtl
::
OUString
;
////////////////////////////////////////
//
...
...
@@ -1157,11 +1158,13 @@ void SmShowSymbolSet::Paint(const Rectangle&)
SetTextColor
(
aTxtColor
);
int
nIV
=
i
-
v
;
Size
aSize
(
GetTextWidth
(
aSymbol
.
GetCharacter
()),
GetTextHeight
());
sal_UCS4
cChar
=
aSymbol
.
GetCharacter
();
String
aText
(
OUString
(
&
cChar
,
1
)
);
Size
aSize
(
GetTextWidth
(
aText
),
GetTextHeight
());
DrawText
(
Point
((
nIV
%
nColumns
)
*
nLen
+
(
nLen
-
aSize
.
Width
())
/
2
,
(
nIV
/
nColumns
)
*
nLen
+
(
nLen
-
aSize
.
Height
())
/
2
),
a
Symbol
.
GetCharacter
()
);
a
Text
);
}
if
(
nSelectSymbol
!=
SYMBOL_NONE
)
...
...
@@ -1360,7 +1363,9 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol)
// keep old text color (font may have different color set)
SetTextColor
(
aTxtColor
);
SetText
(
XubString
(
pSymbol
->
GetCharacter
()));
sal_UCS4
cChar
=
pSymbol
->
GetCharacter
();
String
aText
(
OUString
(
&
cChar
,
1
)
);
SetText
(
aText
);
}
// 'Invalidate' fuellt den background mit der background-Farbe.
...
...
@@ -1483,8 +1488,9 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG pButton )
const
SmSym
*
pSym
=
GetSymbol
();
if
(
pSym
)
{
XubString
aText
(
'%'
);
String
aText
(
'%'
);
aText
+=
pSym
->
GetName
();
aText
+=
(
sal_Unicode
)
' '
;
rViewSh
.
GetViewFrame
()
->
GetDispatcher
()
->
Execute
(
SID_INSERTTEXT
,
SFX_CALLMODE_STANDARD
,
...
...
@@ -1640,31 +1646,36 @@ void SmShowChar::Paint(const Rectangle &rRect)
{
Control
::
Paint
(
rRect
);
XubString
Text
(
GetText
()
);
if
(
Text
.
Len
()
>
0
)
OUString
aText
(
GetText
()
);
if
(
aText
.
getLength
()
>
0
)
{
Size
aTextSize
(
GetTextWidth
(
Text
),
GetTextHeight
());
#if OSL_DEBUG_LEVEL > 1
sal_Int32
nPos
=
0
;
sal_UCS4
cChar
=
aText
.
iterateCodePoints
(
&
nPos
);
(
void
)
cChar
;
#endif
Size
aTextSize
(
GetTextWidth
(
aText
),
GetTextHeight
());
DrawText
(
Point
((
GetOutputSize
().
Width
()
-
aTextSize
.
Width
())
/
2
,
(
GetOutputSize
().
Height
()
-
aTextSize
.
Height
())
/
2
),
Text
);
(
GetOutputSize
().
Height
()
-
aTextSize
.
Height
())
/
2
),
a
Text
);
}
}
void
SmShowChar
::
Set
Char
(
xub_Unicode
aChar
)
void
SmShowChar
::
Set
Symbol
(
const
SmSym
*
pSym
)
{
SetText
(
XubString
(
aChar
));
Invalidate
(
);
if
(
pSym
)
SetSymbol
(
pSym
->
GetCharacter
(),
pSym
->
GetFace
()
);
}
void
SmShowChar
::
Set
Font
(
const
Font
&
rFont
)
void
SmShowChar
::
Set
Symbol
(
sal_UCS4
cChar
,
const
Font
&
rFont
)
{
Color
aTxtColor
(
GetTextColor
()
);
Font
aFont
(
rFont
);
Size
aSize
(
Size
(
0
,
GetOutputSize
().
Height
()
-
GetOutputSize
().
Height
()
/
3
));
Size
aSize
(
Size
(
0
,
GetOutputSize
().
Height
()
-
GetOutputSize
().
Height
()
/
3
));
Font
aFont
(
rFont
);
aFont
.
SetSize
(
aSize
);
aFont
.
SetAlign
(
ALIGN_TOP
);
aFont
.
SetTransparent
(
TRUE
);
...
...
@@ -1673,9 +1684,13 @@ void SmShowChar::SetFont(const Font &rFont)
// keep text color (new font may have different one)
SetTextColor
(
aTxtColor
);
String
aText
(
OUString
(
&
cChar
,
1
)
);
SetText
(
aText
);
Invalidate
();
}
////////////////////////////////////////////////////////////////////////////////
void
SmSymDefineDialog
::
FillSymbols
(
ComboBox
&
rComboBox
,
BOOL
bDeleteText
)
...
...
@@ -1862,7 +1877,7 @@ IMPL_LINK( SmSymDefineDialog, StyleChangeHdl, ComboBox *, EMPTYARG pComboBox )
IMPL_LINK
(
SmSymDefineDialog
,
CharHighlightHdl
,
Control
*
,
EMPTYARG
)
{
sal_UCS4
cChar
=
aCharsetDisplay
.
GetSelectCharacter
();
sal_UCS4
cChar
=
aCharsetDisplay
.
GetSelectCharacter
();
#if OSL_DEBUG_LEVEL > 1
DBG_ASSERT
(
pSubsetMap
,
"SubsetMap missing"
);
...
...
@@ -1876,9 +1891,18 @@ IMPL_LINK( SmSymDefineDialog, CharHighlightHdl, Control *, EMPTYARG )
aFontsSubsetLB
.
SetNoSelection
();
}
// TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality
aSymbolDisplay
.
SetChar
(
sal
::
static_int_cast
<
sal_Unicode
>
(
cChar
)
);
aSymbolDisplay
.
SetSymbol
(
cChar
,
aCharsetDisplay
.
GetFont
()
);
UpdateButtons
();
// display Unicode position as symbol name while iterating over characters
const
String
aHex
(
String
::
CreateFromInt64
(
cChar
,
16
).
ToUpperAscii
()
);
const
String
aPattern
(
A2OU
(
aHex
.
Len
()
>
4
?
"Ux000000"
:
"Ux0000"
)
);
String
aUnicodePos
(
aPattern
.
Copy
(
0
,
aPattern
.
Len
()
-
aHex
.
Len
()
)
);
aUnicodePos
+=
aHex
;
aSymbols
.
SetText
(
aUnicodePos
);
aSymbolName
.
SetText
(
aUnicodePos
);
return
0
;
}
...
...
@@ -1892,16 +1916,13 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG pButton )
#endif
// add symbol
// TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality
const
SmSym
aNewSymbol
(
aSymbols
.
GetText
(),
aCharsetDisplay
.
GetFont
(),
sal
::
static_int_cast
<
sal_Unicode
>
(
aCharsetDisplay
.
GetSelectCharacter
()
),
aSymbolSets
.
GetText
()
);
aCharsetDisplay
.
GetSelectCharacter
(),
aSymbolSets
.
GetText
()
);
//DBG_ASSERT( aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL, "symbol already exists" );
aSymbolMgrCopy
.
AddOrReplaceSymbol
(
aNewSymbol
);
// update display of new symbol
aSymbolDisplay
.
SetChar
(
aNewSymbol
.
GetCharacter
()
);
aSymbolDisplay
.
SetFont
(
aNewSymbol
.
GetFace
()
);
aSymbolDisplay
.
SetSymbol
(
&
aNewSymbol
);
aSymbolName
.
SetText
(
aNewSymbol
.
GetName
()
);
aSymbolSetName
.
SetText
(
aNewSymbol
.
GetSymbolSetName
()
);
...
...
@@ -1928,10 +1949,8 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG pButton )
// get new Sybol to use
//! get font from symbol-disp lay since charset-display does not keep
//! the bold attribut.
// TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality
const
SmSym
aNewSymbol
(
aSymbols
.
GetText
(),
aCharsetDisplay
.
GetFont
(),
sal
::
static_int_cast
<
sal_Unicode
>
(
aCharsetDisplay
.
GetSelectCharacter
()
),
aSymbolSets
.
GetText
()
);
aCharsetDisplay
.
GetSelectCharacter
(),
aSymbolSets
.
GetText
()
);
// remove old symbol if the name was changed then add new one
// const bool bSetNameChanged = aOldSymbolSets.GetText() != aSymbolSets.GetText();
...
...
@@ -1945,8 +1964,7 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG pButton )
SetOrigSymbol
(
NULL
,
XubString
());
// update display of new symbol
aSymbolDisplay
.
SetChar
(
aNewSymbol
.
GetCharacter
()
);
aSymbolDisplay
.
SetFont
(
aNewSymbol
.
GetFace
()
);
aSymbolDisplay
.
SetSymbol
(
&
aNewSymbol
);
aSymbolName
.
SetText
(
aNewSymbol
.
GetName
()
);
aSymbolSetName
.
SetText
(
aNewSymbol
.
GetSymbolSetName
()
);
...
...
@@ -2266,8 +2284,7 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol,
aSymName
=
pSymbol
->
GetName
();
aSymSetName
=
rSymbolSetName
;
aOldSymbolDisplay
.
SetFont
(
pSymbol
->
GetFace
());
aOldSymbolDisplay
.
SetChar
(
pSymbol
->
GetCharacter
());
aOldSymbolDisplay
.
SetSymbol
(
pSymbol
);
}
else
{
// loeschen des angezeigten Symbols
...
...
@@ -2439,7 +2456,7 @@ BOOL SmSymDefineDialog::SelectStyle(const XubString &rStyleName, BOOL bApplyFont
void
SmSymDefineDialog
::
SelectChar
(
xub_Unicode
cChar
)
{
aCharsetDisplay
.
SelectCharacter
(
cChar
);
aSymbolDisplay
.
Set
Char
(
cChar
);
aSymbolDisplay
.
Set
Symbol
(
cChar
,
aCharsetDisplay
.
GetFont
()
);
UpdateButtons
();
}
...
...
starmath/source/node.cxx
Dosyayı görüntüle @
889d495c
...
...
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_starmath.hxx"
#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii))
#include <tools/gen.hxx>
#include <tools/fract.hxx>
#include <rtl/math.hxx>
...
...
@@ -38,23 +37,27 @@
#include <vcl/outdev.hxx>
#include <sfx2/module.hxx>
#include "node.hxx"
#include <rect.hxx>
#include "symbol.hxx"
#include "smmod.hxx"
#include <document.hxx>
#include <view.hxx>
#ifndef _MATHTYPE_HXX
#include "mathtype.hxx"
#endif
#include <math.h>
#include <float.h>
#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii))
// define this to draw rectangles for debugging
//#define SM_RECT_DEBUG
using
::
rtl
::
OUString
;
////////////////////////////////////////
// SmTmpDevice
// Allows for font and color changes. The original settings will be restored
...
...
@@ -2459,6 +2462,12 @@ void SmTextNode::Draw(OutputDevice &rDev, const Point& rPosition) const
// auf Pixelkoordinaten runden
aPos
=
rDev
.
PixelToLogic
(
rDev
.
LogicToPixel
(
aPos
)
);
#if OSL_DEBUG_LEVEL > 1
sal_Int32
nPos
=
0
;
sal_UCS4
cChar
=
OUString
(
aText
).
iterateCodePoints
(
&
nPos
);
(
void
)
cChar
;
#endif
rDev
.
DrawStretchText
(
aPos
,
GetWidth
(),
aText
);
#ifdef SM_RECT_DEBUG
...
...
@@ -2808,7 +2817,9 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
if
(
NULL
!=
(
pSym
=
pp
->
GetSymbolManager
().
GetSymbolByName
(
GetToken
().
aText
)))
{
SetText
(
pSym
->
GetCharacter
()
);
sal_UCS4
cChar
=
pSym
->
GetCharacter
();
String
aText
(
OUString
(
&
cChar
,
1
)
);
SetText
(
aText
);
GetFont
()
=
pSym
->
GetFace
();
}
else
...
...
starmath/source/smres.src
Dosyayı görüntüle @
889d495c
...
...
@@ -1147,7 +1147,7 @@ ModalDialog RID_SYMDEFINEDIALOG
ComboBox 1
{
Pos = MAP_APPFONT ( 59 , 6 ) ;
Size = MAP_APPFONT ( 80 ,
5
0 ) ;
Size = MAP_APPFONT ( 80 ,
10
0 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
...
...
@@ -1162,7 +1162,7 @@ ModalDialog RID_SYMDEFINEDIALOG
ComboBox 2
{
Pos = MAP_APPFONT ( 210 , 6 ) ;
Size = MAP_APPFONT ( 80 ,
5
0 ) ;
Size = MAP_APPFONT ( 80 ,
10
0 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
...
...
@@ -1186,7 +1186,7 @@ ModalDialog RID_SYMDEFINEDIALOG
ComboBox 4
{
Pos = MAP_APPFONT ( 80 , 115 ) ;
Size = MAP_APPFONT ( 100 ,
8
0 ) ;
Size = MAP_APPFONT ( 100 ,
10
0 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
...
...
@@ -1201,7 +1201,7 @@ ModalDialog RID_SYMDEFINEDIALOG
ComboBox 5
{
Pos = MAP_APPFONT ( 80 , 130 ) ;
Size = MAP_APPFONT ( 100 ,
5
0 ) ;
Size = MAP_APPFONT ( 100 ,
10
0 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
...
...
@@ -1217,7 +1217,7 @@ ModalDialog RID_SYMDEFINEDIALOG
{
Border = TRUE ;
Pos = MAP_APPFONT ( 80 , 145 ) ;
Size = MAP_APPFONT ( 100 ,
5
0 ) ;
Size = MAP_APPFONT ( 100 ,
10
0 ) ;
TabStop = TRUE ;
Sort = TRUE ;
DropDown = TRUE ;
...
...
@@ -1233,7 +1233,7 @@ ModalDialog RID_SYMDEFINEDIALOG
{
Border = TRUE ;
Pos = MAP_APPFONT ( 80 , 160 ) ;
Size = MAP_APPFONT ( 100 ,
5
0 ) ;
Size = MAP_APPFONT ( 100 ,
10
0 ) ;
TabStop = TRUE ;
Sort = FALSE ;
DropDown = TRUE ;
...
...
@@ -1249,7 +1249,7 @@ ModalDialog RID_SYMDEFINEDIALOG
{
Border = TRUE;
Pos = MAP_APPFONT ( 80 , 175 ) ;
Size = MAP_APPFONT ( 100 ,
5
0 ) ;
Size = MAP_APPFONT ( 100 ,
10
0 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = FALSE ;
...
...
starmath/source/symbol.cxx
Dosyayı görüntüle @
889d495c
...
...
@@ -78,7 +78,7 @@ SmSym::SmSym(const SmSym& rSymbol)
}
SmSym
::
SmSym
(
const
String
&
rName
,
const
Font
&
rFont
,
sal_U
nicode
cChar
,
SmSym
::
SmSym
(
const
String
&
rName
,
const
Font
&
rFont
,
sal_U
CS4
cChar
,
const
String
&
rSet
,
BOOL
bIsPredefined
)
{
m_aName
=
m_aExportName
=
rName
;
...
...
starmath/source/utility.cxx
Dosyayı görüntüle @
889d495c
...
...
@@ -45,6 +45,8 @@
#include "smdll.hxx"
////////////////////////////////////////////////////////////
// return pointer to active SmViewShell, if this is not possible
// return 0 instead.
//!! Since this method is based on the current focus it is somewhat
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment