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
a016de9e
Kaydet (Commit)
a016de9e
authored
Tem 11, 2002
tarafından
John Marmion
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#98109 - adjustColumnPosition()
üst
1729ee49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
5 deletions
+62
-5
WColumnSelect.hxx
dbaccess/source/ui/inc/WColumnSelect.hxx
+9
-2
WColumnSelect.cxx
dbaccess/source/ui/misc/WColumnSelect.cxx
+53
-3
No files found.
dbaccess/source/ui/inc/WColumnSelect.hxx
Dosyayı görüntüle @
a016de9e
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: WColumnSelect.hxx,v $
*
* $Revision: 1.
4
$
* $Revision: 1.
5
$
*
* last change: $Author:
oj $ $Date: 2001-10-18 06:52:55
$
* last change: $Author:
jmarmion $ $Date: 2002-07-11 13:37:10
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -119,6 +119,13 @@ namespace dbaui
const
::
comphelper
::
TStringMixEqualFunctor
&
_aCase
);
void
enableButtons
();
USHORT
adjustColumnPosition
(
ListBox
*
_pLeft
,
const
::
rtl
::
OUString
&
_sColumnName
,
USHORT
nCurrentPos
,
const
::
comphelper
::
TStringMixEqualFunctor
&
_aCase
);
public
:
virtual
void
Reset
(
);
virtual
void
ActivatePage
();
...
...
dbaccess/source/ui/misc/WColumnSelect.cxx
Dosyayı görüntüle @
a016de9e
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: WColumnSelect.cxx,v $
*
* $Revision: 1.
7
$
* $Revision: 1.
8
$
*
* last change: $Author:
oj $ $Date: 2002-03-21 07:05:10
$
* last change: $Author:
jmarmion $ $Date: 2002-07-11 13:37:24
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -389,7 +389,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight,
const
ODatabaseExport
::
TColumnVector
*
pSrcVector
=
m_pParent
->
getSrcVector
();
ODatabaseExport
::
TColumnVector
::
const_iterator
aPos
=
::
std
::
find
(
pSrcVector
->
begin
(),
pSrcVector
->
end
(),
aSrcIter
);
OSL_ENSURE
(
aPos
!=
pSrcVector
->
end
(),
"Invalid position for the iterator here!"
);
USHORT
nPos
=
aPos
-
pSrcVector
->
begin
(
);
USHORT
nPos
=
(
aPos
-
pSrcVector
->
begin
())
-
adjustColumnPosition
(
_pLeft
,
_sColumnName
,
(
aPos
-
pSrcVector
->
begin
()),
_aCase
);
_pRight
->
SetEntryData
(
_pRight
->
InsertEntry
(
(
*
aIter
).
first
,
nPos
),
aSrcIter
->
second
);
_rRightColumns
.
push_back
((
*
aIter
).
first
);
...
...
@@ -397,6 +397,56 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight,
}
}
// -----------------------------------------------------------------------------
// Simply returning fields back to their original position is
// not enough. We need to take into acccount what fields have
// been removed earlier and adjust accordingly. Based on the
// algorithm employed in moveColumn().
USHORT
OWizColumnSelect
::
adjustColumnPosition
(
ListBox
*
_pLeft
,
const
::
rtl
::
OUString
&
_sColumnName
,
USHORT
nCurrentPos
,
const
::
comphelper
::
TStringMixEqualFunctor
&
_aCase
)
{
USHORT
nAdjustedPos
=
0
;
// if returning all entries to their original position,
// then there is no need to adjust the positions.
if
(
m_ibColumns_LH
.
HasFocus
())
return
nAdjustedPos
;
sal_uInt16
nCount
=
_pLeft
->
GetEntryCount
();
::
rtl
::
OUString
sColumnString
;
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
{
sColumnString
=
_pLeft
->
GetEntry
(
i
);
if
(
_sColumnName
!=
sColumnString
)
{
// find the new column in the dest name mapping to obtain the old column
OCopyTableWizard
::
TNameMapping
::
iterator
aIter
=
::
std
::
find_if
(
m_pParent
->
m_mNameMapping
.
begin
(),
m_pParent
->
m_mNameMapping
.
end
(),
::
std
::
compose1
(
::
std
::
bind2nd
(
_aCase
,
sColumnString
),
::
std
::
select2nd
<
OCopyTableWizard
::
TNameMapping
::
value_type
>
())
);
DBG_ASSERT
(
aIter
!=
m_pParent
->
m_mNameMapping
.
end
(),
"Column must be defined"
);
const
ODatabaseExport
::
TColumns
*
pSrcColumns
=
m_pParent
->
getSourceColumns
();
ODatabaseExport
::
TColumns
::
const_iterator
aSrcIter
=
pSrcColumns
->
find
((
*
aIter
).
first
);
if
(
aSrcIter
!=
pSrcColumns
->
end
()
)
{
// we need also the old position of this column to insert it back on that position again
const
ODatabaseExport
::
TColumnVector
*
pSrcVector
=
m_pParent
->
getSrcVector
();
ODatabaseExport
::
TColumnVector
::
const_iterator
aPos
=
::
std
::
find
(
pSrcVector
->
begin
(),
pSrcVector
->
end
(),
aSrcIter
);
USHORT
nPos
=
aPos
-
pSrcVector
->
begin
();
if
(
nPos
<
nCurrentPos
)
{
nAdjustedPos
++
;
}
}
}
}
return
nAdjustedPos
;
}
// -----------------------------------------------------------------------------
void
OWizColumnSelect
::
enableButtons
()
{
sal_Bool
bEntries
=
m_lbNewColumnNames
.
GetEntryCount
()
!=
0
;
...
...
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