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
fc0bbb4f
Kaydet (Commit)
fc0bbb4f
authored
Ara 16, 2011
tarafından
Muthu Subramanian
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#33602: Preserving dbf import/export charset.
üst
b00c4ec0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
2 deletions
+84
-2
Calc.xcs
officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+26
-0
filtuno.cxx
sc/source/ui/unoobj/filtuno.cxx
+58
-2
No files found.
officecfg/registry/schema/org/openoffice/Office/Calc.xcs
Dosyayı görüntüle @
fc0bbb4f
...
...
@@ -1029,6 +1029,32 @@
<info>
<desc>
Contains the dialogs settings.
</desc>
</info>
<group
oor:name=
"DBFImport"
>
<info>
<desc>
Contains settings for DBF Import dialog
</desc>
</info>
<prop
oor:name=
"CharSet"
oor:type=
"xs:int"
>
<info>
<author>
muthusuba
</author>
<desc>
Charset/Language
</desc>
<label>
CharSet
</label>
</info>
<value>
-1
</value>
</prop>
</group>
<group
oor:name=
"DBFExport"
>
<info>
<desc>
Contains settings for DBF Export dialog
</desc>
</info>
<prop
oor:name=
"CharSet"
oor:type=
"xs:int"
>
<info>
<author>
muthusuba
</author>
<desc>
Charset/Language
</desc>
<label>
CharSet
</label>
</info>
<value>
-1
</value>
</prop>
</group>
<group
oor:name=
"CSVImport"
>
<info>
<desc>
Contains setting for Text CSV Import
</desc>
...
...
sc/source/ui/unoobj/filtuno.cxx
Dosyayı görüntüle @
fc0bbb4f
...
...
@@ -51,8 +51,15 @@
#include <memory>
#include <optutil.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
using
namespace
::
com
::
sun
::
star
;
using
::
rtl
::
OUStringBuffer
;
using
namespace
rtl
;
using
namespace
com
::
sun
::
star
::
uno
;
//------------------------------------------------------------------------
...
...
@@ -66,6 +73,55 @@ SC_SIMPLE_SERVICE_INFO( ScFilterOptionsObj, SCFILTEROPTIONSOBJ_IMPLNAME, SCFILTE
#define SC_UNONAME_FILTEROPTIONS "FilterOptions"
#define SC_UNONAME_INPUTSTREAM "InputStream"
#define DBF_CHAR_SET "CharSet"
#define DBF_SEP_PATH_IMPORT "Office.Calc/Dialogs/DBFImport"
#define DBF_SEP_PATH_EXPORT "Office.Calc/Dialogs/DBFExport"
//------------------------------------------------------------------------
static
void
load_CharSet
(
rtl_TextEncoding
&
nCharSet
,
bool
bExport
)
{
sal_Int32
nChar
;
Sequence
<
Any
>
aValues
;
const
Any
*
pProperties
;
Sequence
<
OUString
>
aNames
(
1
);
OUString
*
pNames
=
aNames
.
getArray
();
ScLinkConfigItem
aItem
(
OUString
::
createFromAscii
(
bExport
?
DBF_SEP_PATH_EXPORT
:
DBF_SEP_PATH_IMPORT
)
);
pNames
[
0
]
=
OUString
::
createFromAscii
(
DBF_CHAR_SET
);
aValues
=
aItem
.
GetProperties
(
aNames
);
pProperties
=
aValues
.
getConstArray
();
// Default choice
nCharSet
=
RTL_TEXTENCODING_IBM_850
;
if
(
pProperties
[
0
].
hasValue
()
)
{
pProperties
[
0
]
>>=
nChar
;
if
(
nChar
>=
0
)
nCharSet
=
(
rtl_TextEncoding
)
nChar
;
}
}
static
void
save_CharSet
(
rtl_TextEncoding
nCharSet
,
bool
bExport
)
{
Sequence
<
Any
>
aValues
;
Any
*
pProperties
;
Sequence
<
OUString
>
aNames
(
1
);
OUString
*
pNames
=
aNames
.
getArray
();
ScLinkConfigItem
aItem
(
OUString
::
createFromAscii
(
bExport
?
DBF_SEP_PATH_EXPORT
:
DBF_SEP_PATH_IMPORT
)
);
pNames
[
0
]
=
OUString
::
createFromAscii
(
DBF_CHAR_SET
);
aValues
=
aItem
.
GetProperties
(
aNames
);
pProperties
=
aValues
.
getArray
();
pProperties
[
0
]
<<=
(
sal_Int32
)
nCharSet
;
aItem
.
PutProperties
(
aNames
,
aValues
);
}
//------------------------------------------------------------------------
ScFilterOptionsObj
::
ScFilterOptionsObj
()
:
...
...
@@ -250,8 +306,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
// dBase import
aTitle
=
ScGlobal
::
GetRscString
(
STR_IMPORT_DBF
);
}
// common for dBase import/export
eEncoding
=
RTL_TEXTENCODING_IBM_850
;
load_CharSet
(
eEncoding
,
bExport
);
bDBEnc
=
sal_True
;
}
else
if
(
aFilterString
==
ScDocShell
::
GetDifFilterName
()
)
...
...
@@ -279,6 +334,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
if
(
pDlg
->
Execute
()
==
RET_OK
)
{
pDlg
->
GetImportOptions
(
aOptions
);
save_CharSet
(
aOptions
.
eCharSet
,
bExport
);
if
(
bAscii
)
aFilterOptions
=
aOptions
.
BuildString
();
else
...
...
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