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
6e370ddd
Kaydet (Commit)
6e370ddd
authored
Haz 10, 2014
tarafından
Jürgen Schmidt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#122368# convert inc paths into short form on windows to avoid problem with ucpp
üst
4710644c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletion
+53
-1
options.cxx
idlc/source/options.cxx
+53
-1
No files found.
idlc/source/options.cxx
Dosyayı görüntüle @
6e370ddd
...
...
@@ -30,6 +30,28 @@
#include "rtl/string.hxx"
#include "rtl/strbuf.hxx"
#include "rtl/ustring.hxx"
#include "osl/file.hxx"
#ifdef WNT
# include <windows.h>
#endif
/*
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# ifdef _MSC_VER
# pragma warning(push,1)
# endif
# include <windows.h>
# ifdef _MSC_VER
# pragma warning(pop)
# endif
# include <tchar.h>
# undef WIN32_LEAN_AND_MEAN
#endif
*/
#include <stdio.h>
#include <string.h>
...
...
@@ -182,6 +204,28 @@ bool Options::setOption(char const * option, std::string const & rArg)
return
(
result
);
}
#ifdef WNT
/* Helper functiopn to convert windows paths including spaces, brackets etc. into
a windows short Url. The ucpp preprocessor has problems with such paths and returns
with error.
*/
OString
convertIncPathtoShortWindowsPath
(
const
OString
&
incPath
)
{
rtl
::
OUString
path
=
OStringToOUString
(
incPath
,
RTL_TEXTENCODING_UTF8
);
std
::
vector
<
sal_Unicode
>
vec
(
path
.
getLength
()
+
1
);
//GetShortPathNameW only works if the file can be found!
const
DWORD
len
=
GetShortPathNameW
(
reinterpret_cast
<
LPCWSTR
>
(
path
.
getStr
()),
reinterpret_cast
<
LPWSTR
>
(
&
vec
[
0
]),
path
.
getLength
()
+
1
);
rtl
::
OUString
ret
=
rtl
::
OUString
(
&
vec
[
0
],
len
);
if
(
len
>
0
)
return
OUStringToOString
(
ret
,
RTL_TEXTENCODING_UTF8
);
return
incPath
;
}
#endif
bool
Options
::
initOptions
(
std
::
vector
<
std
::
string
>
&
rArgs
)
throw
(
IllegalArgument
)
{
std
::
vector
<
std
::
string
>::
const_iterator
first
=
rArgs
.
begin
(),
last
=
rArgs
.
end
();
...
...
@@ -225,7 +269,15 @@ bool Options::initOptions(std::vector< std::string > & rArgs) throw(IllegalArgum
sal_Int32
k
=
0
;
do
{
OStringBuffer
token
;
token
.
append
(
"-I"
);
token
.
append
(
param
.
getToken
(
0
,
';'
,
k
));
OStringBuffer
token
;
token
.
append
(
"-I"
);
#ifdef WNT
rtl
::
OString
incpath
=
convertIncPathtoShortWindowsPath
(
param
.
getToken
(
0
,
';'
,
k
));
#else
rtl
::
OString
incpath
=
param
.
getToken
(
0
,
';'
,
k
);
#endif
token
.
append
(
incpath
);
//token.append(param.getToken(0, ';', k));
if
(
buffer
.
getLength
()
>
0
)
buffer
.
append
(
' '
);
buffer
.
append
(
token
);
...
...
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