View | Details | Raw Unified | Return to issue 18728
Collapse All | Expand All

(-)officecfg/registry/schema/org/openoffice/Office/Calc.xcs (+26 lines)
Lines 1023-1028 Link Here
1023
            <info>
1023
            <info>
1024
                <desc>Contains the dialogs settings.</desc>
1024
                <desc>Contains the dialogs settings.</desc>
1025
            </info>
1025
            </info>
1026
            <group oor:name="DBFImport">
1027
                <info>
1028
                    <desc>Contains settings for DBF Import dialog</desc>
1029
                </info>
1030
                <prop oor:name="CharSet" oor:type="xs:int">
1031
                    <info>
1032
                        <author>muthusuba</author>
1033
                        <desc>Charset/Language</desc>
1034
                        <label>CharSet</label>
1035
                    </info>
1036
                    <value>-1</value>
1037
                </prop>
1038
            </group>
1039
            <group oor:name="DBFExport">
1040
                <info>
1041
                    <desc>Contains settings for DBF Export dialog</desc>
1042
                </info>
1043
                <prop oor:name="CharSet" oor:type="xs:int">
1044
                    <info>
1045
                        <author>muthusuba</author>
1046
                        <desc>Charset/Language</desc>
1047
                        <label>CharSet</label>
1048
                    </info>
1049
                    <value>-1</value>
1050
                </prop>
1051
            </group>
1026
            <group oor:name="CSVImport">
1052
            <group oor:name="CSVImport">
1027
                <info>
1053
                <info>
1028
                    <desc>Contains setting for Text CSV Import</desc>
1054
                    <desc>Contains setting for Text CSV Import</desc>
(-)sc/source/ui/unoobj/filtuno.cxx (-2 / +58 lines)
Lines 55-62 Link Here
55
55
56
#include <memory>
56
#include <memory>
57
57
58
#include <optutil.hxx>
59
#include <com/sun/star/uno/Any.hxx>
60
#include <com/sun/star/uno/Sequence.hxx>
61
62
58
using namespace ::com::sun::star;
63
using namespace ::com::sun::star;
59
using ::rtl::OUStringBuffer;
64
using ::rtl::OUStringBuffer;
65
using namespace rtl;
66
using namespace com::sun::star::uno;
60
67
61
//------------------------------------------------------------------------
68
//------------------------------------------------------------------------
62
69
Lines 70-77 SC_SIMPLE_SERVICE_INFO( ScFilterOptionsO Link Here
70
#define SC_UNONAME_FILTEROPTIONS	"FilterOptions"
77
#define SC_UNONAME_FILTEROPTIONS	"FilterOptions"
71
#define SC_UNONAME_INPUTSTREAM		"InputStream"
78
#define SC_UNONAME_INPUTSTREAM		"InputStream"
72
79
80
81
#define DBF_CHAR_SET                "CharSet"
82
#define DBF_SEP_PATH_IMPORT         "Office.Calc/Dialogs/DBFImport"
83
#define DBF_SEP_PATH_EXPORT         "Office.Calc/Dialogs/DBFExport"
84
85
//------------------------------------------------------------------------
86
87
static void load_CharSet( rtl_TextEncoding &nCharSet, bool bExport )
88
{
89
    sal_Int32 nChar;
90
    Sequence<Any> aValues;
91
    const Any *pProperties;
92
    Sequence<OUString> aNames(1);
93
    OUString* pNames = aNames.getArray();
94
    ScLinkConfigItem aItem( OUString::createFromAscii( 
95
                                bExport?DBF_SEP_PATH_EXPORT:DBF_SEP_PATH_IMPORT ) );
96
97
    pNames[0] = OUString::createFromAscii( DBF_CHAR_SET );
98
    aValues = aItem.GetProperties( aNames );
99
    pProperties = aValues.getConstArray();
100
101
    // Default choice
102
    nCharSet = RTL_TEXTENCODING_IBM_850;
103
104
    if( pProperties[0].hasValue() )
105
    {
106
        pProperties[0] >>= nChar;
107
        if( nChar >= 0)
108
            nCharSet = (rtl_TextEncoding) nChar;
109
    }
110
}
111
112
static void save_CharSet( rtl_TextEncoding nCharSet, bool bExport )
113
{
114
    Sequence<Any> aValues;
115
    Any *pProperties;
116
    Sequence<OUString> aNames(1);
117
    OUString* pNames = aNames.getArray();
118
    ScLinkConfigItem aItem( OUString::createFromAscii(
119
                                bExport?DBF_SEP_PATH_EXPORT:DBF_SEP_PATH_IMPORT ) );
120
121
    pNames[0] = OUString::createFromAscii( DBF_CHAR_SET );
122
    aValues = aItem.GetProperties( aNames );
123
    pProperties = aValues.getArray();
124
    pProperties[0] <<= (sal_Int32) nCharSet;
125
126
    aItem.PutProperties(aNames, aValues);
127
}
128
73
//------------------------------------------------------------------------
129
//------------------------------------------------------------------------
74
130
75
ScFilterOptionsObj::ScFilterOptionsObj() :
131
ScFilterOptionsObj::ScFilterOptionsObj() :
76
    bExport( sal_False )
132
    bExport( sal_False )
77
{
133
{
Lines 251-257 sal_Int16 SAL_CALL ScFilterOptionsObj::e Link Here
251
                aTitle = ScGlobal::GetRscString( STR_IMPORT_DBF );
308
                aTitle = ScGlobal::GetRscString( STR_IMPORT_DBF );
252
            }
309
            }
253
            // common for dBase import/export
310
            load_CharSet( eEncoding, bExport );
254
            eEncoding = RTL_TEXTENCODING_IBM_850;
255
            bDBEnc = sal_True;
311
            bDBEnc = sal_True;
256
        }
312
        }
257
        else if ( aFilterString == ScDocShell::GetDifFilterName() )
313
        else if ( aFilterString == ScDocShell::GetDifFilterName() )
Lines 283-288 sal_Int16 SAL_CALL ScFilterOptionsObj::e Link Here
283
        if ( pDlg->Execute() == RET_OK )
340
        if ( pDlg->Execute() == RET_OK )
284
        {
341
        {
285
            pDlg->GetImportOptions( aOptions );
342
            pDlg->GetImportOptions( aOptions );
343
            save_CharSet( aOptions.eCharSet, bExport );
286
            if ( bAscii )
344
            if ( bAscii )
287
                aFilterOptions = aOptions.BuildString();
345
                aFilterOptions = aOptions.BuildString();
288
            else
346
            else

Return to issue 18728