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