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
784e472a
Kaydet (Commit)
784e472a
authored
May 20, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Math: Use shared_ptr in ElementsDockingWindow
Change-Id: Id31765f0c2f47cd2ebe830a8b42a9397d6eeffae
üst
5ef00157
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
37 deletions
+40
-37
ElementsDockingWindow.hxx
starmath/inc/ElementsDockingWindow.hxx
+22
-20
node.hxx
starmath/inc/node.hxx
+1
-0
ElementsDockingWindow.cxx
starmath/source/ElementsDockingWindow.cxx
+17
-17
No files found.
starmath/inc/ElementsDockingWindow.hxx
Dosyayı görüntüle @
784e472a
...
...
@@ -19,34 +19,33 @@
#ifndef _ELEMENTSDOCKINGWINDOW_HXX_
#define _ELEMENTSDOCKINGWINDOW_HXX_
#include <sfx2/ctrlitem.hxx>
#include <sfx2/dockwin.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/graph.hxx>
#include <svx/dlgctrl.hxx>
#include <document.hxx>
#include <node.hxx>
class
SmElement
{
SmNode
*
mpNode
;
OUString
maText
;
SmNode
Pointer
mpNode
;
OUString
maText
;
public
:
SmElement
(
SmNode
*
pNode
,
OUString
aText
);
Point
mBoxLocation
;
Size
mBoxSize
;
SmElement
(
SmNodePointer
pNode
,
OUString
aText
);
virtual
~
SmElement
();
SmNode
*
getNode
();
OUString
getText
()
{
return
maText
;
}
SmNodePointer
getNode
();
OUString
getText
()
{
return
maText
;
}
virtual
bool
isSeparator
()
{
return
false
;
}
Point
mBoxLocation
;
Size
mBoxSize
;
};
class
SmElementSeparator
:
public
SmElement
...
...
@@ -79,13 +78,16 @@ class SmElementsControl : public Control
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
);
virtual
void
MouseMove
(
const
MouseEvent
&
rMEvt
);
SmDocShell
*
mpDocShell
;
SmFormat
maFormat
;
sal_uInt16
maCurrentSetId
;
SmElement
*
mpCurrentElement
;
typedef
boost
::
shared_ptr
<
SmElement
>
SmElementPointer
;
typedef
std
::
vector
<
SmElementPointer
>
SmElementList
;
SmDocShell
*
mpDocShell
;
SmFormat
maFormat
;
sal_uInt16
maCurrentSetId
;
SmElement
*
mpCurrentElement
;
std
::
vector
<
SmElement
*>
maElementList
;
Size
maMaxElementDimensions
;
SmElementList
maElementList
;
Size
maMaxElementDimensions
;
void
addElement
(
OUString
aElementVisual
,
OUString
aElementSource
);
...
...
starmath/inc/node.hxx
Dosyayı görüntüle @
784e472a
...
...
@@ -57,6 +57,7 @@ class SmDocShell;
class
SmNode
;
class
SmStructureNode
;
typedef
boost
::
shared_ptr
<
SmNode
>
SmNodePointer
;
typedef
std
::
vector
<
SmNode
*
>
SmNodeArray
;
typedef
std
::
vector
<
SmStructureNode
*
>
SmStructureNodeArray
;
...
...
starmath/source/ElementsDockingWindow.cxx
Dosyayı görüntüle @
784e472a
...
...
@@ -18,11 +18,10 @@
*/
#include <ElementsDockingWindow.hxx>
#include <starmath.hrc>
#include <smmod.hxx>
#include <config.hxx>
#include <node.hxx>
#include <view.hxx>
#include <visitors.hxx>
...
...
@@ -32,7 +31,7 @@
SV_DECL_REF
(
SmDocShell
)
SV_IMPL_REF
(
SmDocShell
)
SmElement
::
SmElement
(
SmNode
*
pNode
,
OUString
aText
)
:
SmElement
::
SmElement
(
SmNode
Pointer
pNode
,
OUString
aText
)
:
mpNode
(
pNode
),
maText
(
aText
)
{}
...
...
@@ -40,15 +39,15 @@ SmElement::SmElement(SmNode* pNode, OUString aText) :
SmElement
::~
SmElement
()
{}
SmElementSeparator
::
SmElementSeparator
()
:
SmElement
(
NULL
,
OUString
())
{}
SmNode
*
SmElement
::
getNode
()
SmNodePointer
SmElement
::
getNode
()
{
return
mpNode
;
}
SmElementSeparator
::
SmElementSeparator
()
:
SmElement
(
SmNodePointer
(),
OUString
())
{}
//////////////////////////////////
const
sal_uInt16
SmElementsControl
::
aUnaryBinaryOperatorsList
[]
=
...
...
@@ -203,7 +202,7 @@ void SmElementsControl::Paint(const Rectangle&)
for
(
sal_uInt16
i
=
0
;
i
<
maElementList
.
size
()
;
i
++
)
{
SmElement
*
element
=
maElementList
[
i
];
SmElement
*
element
=
maElementList
[
i
]
.
get
()
;
if
(
element
->
isSeparator
())
{
x
=
0
;
...
...
@@ -235,7 +234,7 @@ void SmElementsControl::Paint(const Rectangle&)
}
Point
location
(
x
+
((
boxX
-
aSizePixel
.
Width
())
/
2
),
y
+
((
boxY
-
aSizePixel
.
Height
())
/
2
));
SmDrawingVisitor
(
*
this
,
PixelToLogic
(
location
),
element
->
getNode
());
SmDrawingVisitor
(
*
this
,
PixelToLogic
(
location
),
element
->
getNode
()
.
get
()
);
element
->
mBoxLocation
=
Point
(
x
,
y
);
element
->
mBoxSize
=
Size
(
boxX
,
boxY
);
...
...
@@ -254,7 +253,7 @@ void SmElementsControl::MouseMove( const MouseEvent& rMouseEvent )
{
for
(
sal_uInt16
i
=
0
;
i
<
maElementList
.
size
()
;
i
++
)
{
SmElement
*
element
=
maElementList
[
i
];
SmElement
*
element
=
maElementList
[
i
]
.
get
()
;
Rectangle
rect
(
element
->
mBoxLocation
,
element
->
mBoxSize
);
if
(
rect
.
IsInside
(
rMouseEvent
.
GetPosPixel
()))
{
...
...
@@ -280,7 +279,7 @@ void SmElementsControl::MouseButtonDown(const MouseEvent& rMouseEvent)
{
for
(
sal_uInt16
i
=
0
;
i
<
maElementList
.
size
()
;
i
++
)
{
SmElement
*
element
=
maElementList
[
i
];
SmElement
*
element
=
maElementList
[
i
]
.
get
()
;
Rectangle
rect
(
element
->
mBoxLocation
,
element
->
mBoxSize
);
if
(
rect
.
IsInside
(
rMouseEvent
.
GetPosPixel
()))
{
...
...
@@ -297,13 +296,14 @@ void SmElementsControl::MouseButtonDown(const MouseEvent& rMouseEvent)
void
SmElementsControl
::
addSeparator
()
{
SmElement
*
pElement
=
new
SmElementSeparator
(
);
SmElement
Pointer
pElement
(
new
SmElementSeparator
()
);
maElementList
.
push_back
(
pElement
);
}
void
SmElementsControl
::
addElement
(
OUString
aElementVisual
,
OUString
aElementSource
)
{
SmNode
*
pNode
=
SmParser
().
ParseExpression
(
aElementVisual
);
SmNodePointer
pNode
(
SmParser
().
ParseExpression
(
aElementVisual
));
pNode
->
Prepare
(
maFormat
,
*
mpDocShell
);
pNode
->
SetSize
(
Fraction
(
10
,
8
));
pNode
->
Arrange
(
*
this
,
maFormat
);
...
...
@@ -317,7 +317,7 @@ void SmElementsControl::addElement(OUString aElementVisual, OUString aElementSou
maMaxElementDimensions
.
Height
()
=
aSizePixel
.
Height
();
}
SmElement
*
pElement
=
new
SmElement
(
pNode
,
aElementSource
);
SmElement
Pointer
pElement
(
new
SmElement
(
pNode
,
aElementSource
)
);
maElementList
.
push_back
(
pElement
);
}
...
...
@@ -328,9 +328,9 @@ void SmElementsControl::setElementSetId(sal_uInt16 aSetId)
build
();
}
void
SmElementsControl
::
addElements
(
const
sal_uInt16
aElementsArray
[],
sal_uInt16
s
ize
)
void
SmElementsControl
::
addElements
(
const
sal_uInt16
aElementsArray
[],
sal_uInt16
aElementsArrayS
ize
)
{
for
(
sal_uInt16
i
=
0
;
i
<
s
ize
;
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
aElementsArrayS
ize
;
i
++
)
{
sal_uInt16
aElementId
=
aElementsArray
[
i
];
if
(
aElementId
==
0xFFFF
)
{
...
...
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