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
8a8623d8
Kaydet (Commit)
8a8623d8
authored
Kas 04, 2015
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use more proper integer types
Change-Id: I9e1ac9f9a8d1954f570594df58c6421de13c79db
üst
117ff653
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
27 deletions
+30
-27
svdibrow.hxx
svx/inc/svdibrow.hxx
+4
-4
svdibrow.cxx
svx/source/svdraw/svdibrow.cxx
+26
-23
No files found.
svx/inc/svdibrow.hxx
Dosyayı görüntüle @
8a8623d8
...
...
@@ -51,12 +51,12 @@ friend class ImpItemEdit;
private
:
void
ImpCtor
();
void
ImpSetEntry
(
const
ImpItemListRow
&
rEntry
,
s
al_uIntPtr
nEntryNum
);
ImpItemListRow
*
ImpGetEntry
(
s
al_uIntPtr
nPos
)
const
{
return
aList
[
nPos
];
}
void
ImpSetEntry
(
const
ImpItemListRow
&
rEntry
,
s
td
::
size_t
nEntryNum
);
ImpItemListRow
*
ImpGetEntry
(
s
td
::
size_t
nPos
)
const
{
return
aList
[
nPos
];
}
void
ImpSaveWhich
();
void
ImpRestoreWhich
();
s
al_uIntPtr
GetCurrentPos
()
const
;
bool
BeginChangeEntry
(
s
al_uIntPtr
nPos
);
s
td
::
size_t
GetCurrentPos
()
const
;
bool
BeginChangeEntry
(
s
td
::
size_t
nPos
);
protected
:
virtual
long
GetRowCount
()
const
override
;
...
...
svx/source/svdraw/svdibrow.cxx
Dosyayı görüntüle @
8a8623d8
...
...
@@ -18,6 +18,7 @@
*/
#include <stdlib.h>
#include <limits>
#include "editeng/fontitem.hxx"
#include "svdibrow.hxx"
...
...
@@ -63,6 +64,8 @@ using namespace com::sun::star;
#define ITEMBROWSER_NAMECOL_ID 4
#define ITEMBROWSER_VALUECOL_ID 5
#define ITEM_NOT_FOUND std::numeric_limits<std::size_t>::max()
enum
ItemType
{
ITEM_DONTKNOW
,
ITEM_BYTE
,
ITEM_INT16
,
ITEM_UINT16
,
ITEM_INT32
,
ITEM_UINT32
,
ITEM_ENUM
,
ITEM_BOOL
,
ITEM_FLAG
,
ITEM_STRING
,
ITEM_POINT
,
ITEM_RECT
,
ITEM_RANGE
,
ITEM_LRANGE
,
...
...
@@ -279,8 +282,8 @@ void _SdrItemBrowserControl::ImpCtor()
void
_SdrItemBrowserControl
::
Clear
()
{
sal_uIntPtr
nCount
=
aList
.
size
();
for
(
s
al_uIntPtr
nNum
=
0
;
nNum
<
nCount
;
nNum
++
)
{
const
std
::
size_t
nCount
=
aList
.
size
();
for
(
s
td
::
size_t
nNum
=
0
;
nNum
<
nCount
;
++
nNum
)
{
delete
ImpGetEntry
(
nNum
);
}
aList
.
clear
();
...
...
@@ -342,7 +345,7 @@ OUString _SdrItemBrowserControl::GetCellText(long _nRow, sal_uInt16 _nColId) con
void
_SdrItemBrowserControl
::
PaintField
(
OutputDevice
&
rDev
,
const
Rectangle
&
rRect
,
sal_uInt16
nColumnId
)
const
{
if
(
nAktPaintRow
<
0
||
(
sal_uIntPtr
)
nAktPaintRow
>=
aList
.
size
())
{
if
(
nAktPaintRow
<
0
||
static_cast
<
std
::
size_t
>
(
nAktPaintRow
)
>=
aList
.
size
())
{
return
;
}
Rectangle
aR
(
rRect
);
...
...
@@ -366,13 +369,13 @@ void _SdrItemBrowserControl::PaintField(OutputDevice& rDev, const Rectangle& rRe
}
}
s
al_uIntPtr
_SdrItemBrowserControl
::
GetCurrentPos
()
const
s
td
::
size_t
_SdrItemBrowserControl
::
GetCurrentPos
()
const
{
s
al_uIntPtr
nRet
=
CONTAINER_ENTRY_NOT
FOUND
;
s
td
::
size_t
nRet
=
ITEM_NOT_
FOUND
;
if
(
GetSelectRowCount
()
==
1
)
{
long
nPos
=
static_cast
<
BrowseBox
*>
(
const_cast
<
_SdrItemBrowserControl
*>
(
this
))
->
FirstSelectedRow
();
if
(
nPos
>=
0
&&
(
sal_uIntPtr
)
nPos
<
aList
.
size
())
{
nRet
=
(
sal_uIntPtr
)
nPos
;
if
(
nPos
>=
0
&&
static_cast
<
std
::
size_t
>
(
nPos
)
<
aList
.
size
())
{
nRet
=
static_cast
<
std
::
size_t
>
(
nPos
)
;
}
}
return
nRet
;
...
...
@@ -381,8 +384,8 @@ sal_uIntPtr _SdrItemBrowserControl::GetCurrentPos() const
sal_uInt16
_SdrItemBrowserControl
::
GetCurrentWhich
()
const
{
sal_uInt16
nRet
=
0
;
sal_uIntPtr
nPos
=
GetCurrentPos
();
if
(
nPos
!=
CONTAINER_ENTRY_NOT
FOUND
)
{
const
std
::
size_t
nPos
=
GetCurrentPos
();
if
(
nPos
!=
ITEM_NOT_
FOUND
)
{
nRet
=
ImpGetEntry
(
nPos
)
->
nWhichId
;
}
return
nRet
;
...
...
@@ -390,8 +393,8 @@ sal_uInt16 _SdrItemBrowserControl::GetCurrentWhich() const
void
_SdrItemBrowserControl
::
DoubleClick
(
const
BrowserMouseEvent
&
)
{
sal_uIntPtr
nPos
=
GetCurrentPos
();
if
(
nPos
!=
CONTAINER_ENTRY_NOT
FOUND
)
{
const
std
::
size_t
nPos
=
GetCurrentPos
();
if
(
nPos
!=
ITEM_NOT_
FOUND
)
{
BeginChangeEntry
(
nPos
);
}
}
...
...
@@ -400,8 +403,8 @@ void _SdrItemBrowserControl::KeyInput(const KeyEvent& rKEvt)
{
sal_uInt16
nKeyCode
=
rKEvt
.
GetKeyCode
().
GetCode
()
+
rKEvt
.
GetKeyCode
().
GetModifier
();
bool
bAusgewertet
=
false
;
sal_uIntPtr
nPos
=
GetCurrentPos
();
if
(
nPos
!=
CONTAINER_ENTRY_NOT
FOUND
)
{
const
std
::
size_t
nPos
=
GetCurrentPos
();
if
(
nPos
!=
ITEM_NOT_
FOUND
)
{
if
(
nKeyCode
==
KEY_RETURN
)
{
if
(
BeginChangeEntry
(
nPos
))
bAusgewertet
=
true
;
}
else
if
(
nKeyCode
==
KEY_ESCAPE
)
{
...
...
@@ -468,8 +471,8 @@ void _SdrItemBrowserControl::ImpRestoreWhich()
{
if
(
nLastWhich
!=
0
)
{
bool
bFnd
=
false
;
sal_uIntPtr
nCount
=
aList
.
size
();
s
al_uIntPtr
nNum
;
const
std
::
size_t
nCount
=
aList
.
size
();
s
td
::
size_t
nNum
;
for
(
nNum
=
0
;
nNum
<
nCount
&&
!
bFnd
;
nNum
++
)
{
ImpItemListRow
*
pEntry
=
ImpGetEntry
(
nNum
);
if
(
!
pEntry
->
bComment
)
{
...
...
@@ -488,7 +491,7 @@ void _SdrItemBrowserControl::ImpRestoreWhich()
}
}
bool
_SdrItemBrowserControl
::
BeginChangeEntry
(
s
al_uIntPtr
nPos
)
bool
_SdrItemBrowserControl
::
BeginChangeEntry
(
s
td
::
size_t
nPos
)
{
BreakChangeEntry
();
bool
bRet
=
false
;
...
...
@@ -555,7 +558,7 @@ void _SdrItemBrowserControl::BreakChangeEntry()
}
}
void
_SdrItemBrowserControl
::
ImpSetEntry
(
const
ImpItemListRow
&
rEntry
,
s
al_uIntPtr
nEntryNum
)
void
_SdrItemBrowserControl
::
ImpSetEntry
(
const
ImpItemListRow
&
rEntry
,
s
td
::
size_t
nEntryNum
)
{
SAL_WARN_IF
(
nEntryNum
>
aList
.
size
(),
"svx"
,
"trying to set item "
<<
nEntryNum
<<
"in a vector of size "
<<
aList
.
size
());
if
(
nEntryNum
>=
aList
.
size
())
{
...
...
@@ -1164,7 +1167,7 @@ IMPL_LINK_TYPED(SdrItemBrowser, ChangedHdl, _SdrItemBrowserControl&, rBrowse, vo
if
(
!
bDel
)
{
SfxPoolItem
*
pNewItem
=
aSet
.
Get
(
pEntry
->
nWhichId
).
Clone
();
long
nLongVal
=
aNewText
.
toInt32
();
sal_Int32
nLongVal
=
aNewText
.
toInt32
();
if
(
pEntry
->
bCanNum
)
{
if
(
nLongVal
>
pEntry
->
nMax
)
nLongVal
=
pEntry
->
nMax
;
if
(
nLongVal
<
pEntry
->
nMin
)
nLongVal
=
pEntry
->
nMin
;
...
...
@@ -1194,9 +1197,9 @@ IMPL_LINK_TYPED(SdrItemBrowser, ChangedHdl, _SdrItemBrowserControl&, rBrowse, vo
{
aNewText
=
aNewText
.
replace
(
','
,
'.'
);
double
nVal
=
aNewText
.
toFloat
();
nLongVal
=
(
long
)(
nVal
*
10
0
+
0.5
);
nLongVal
=
static_cast
<
sal_Int32
>
(
nVal
*
100.
0
+
0.5
);
}
static_cast
<
SfxInt32Item
*>
(
pNewItem
)
->
SetValue
(
(
sal_Int32
)
nLongVal
);
static_cast
<
SfxInt32Item
*>
(
pNewItem
)
->
SetValue
(
nLongVal
);
}
break
;
case
ITEM_UINT32
:
static_cast
<
SfxUInt32Item
*>
(
pNewItem
)
->
SetValue
(
aNewText
.
toInt32
());
break
;
case
ITEM_ENUM
:
static_cast
<
SfxEnumItemInterface
*>
(
pNewItem
)
->
SetEnumValue
((
sal_uInt16
)
nLongVal
);
break
;
...
...
@@ -1233,12 +1236,12 @@ IMPL_LINK_TYPED(SdrItemBrowser, ChangedHdl, _SdrItemBrowserControl&, rBrowse, vo
static_cast
<
SvxFontItem
*>
(
pNewItem
)
->
SetStyleName
(
OUString
());
}
break
;
case
ITEM_FONTHEIGHT
:
{
sal_uInt
Ptr
nHgt
=
0
;
sal_uInt
32
nHgt
=
0
;
sal_uInt16
nProp
=
100
;
if
(
aNewText
.
indexOf
(
'%'
)
!=
-
1
)
{
nProp
=
(
sal_uInt16
)
nLongVal
;
nProp
=
static_cast
<
sal_uInt16
>
(
nLongVal
)
;
}
else
{
nHgt
=
nLongVal
;
nHgt
=
static_cast
<
sal_uInt32
>
(
nLongVal
)
;
}
static_cast
<
SvxFontHeightItem
*>
(
pNewItem
)
->
SetHeight
(
nHgt
,
nProp
);
}
break
;
...
...
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