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
6dfe6693
Kaydet (Commit)
6dfe6693
authored
Nis 25, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Support file field in ScEditFieldObj which requires special handling.
üst
d7c4d446
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
7 deletions
+91
-7
fielduno.hxx
sc/inc/fielduno.hxx
+3
-0
fielduno.cxx
sc/source/ui/unoobj/fielduno.cxx
+88
-7
No files found.
sc/inc/fielduno.hxx
Dosyayı görüntüle @
6dfe6693
...
...
@@ -356,6 +356,9 @@ private:
void
setPropertyValueURL
(
const
rtl
::
OUString
&
rName
,
const
com
::
sun
::
star
::
uno
::
Any
&
rVal
);
com
::
sun
::
star
::
uno
::
Any
getPropertyValueURL
(
const
rtl
::
OUString
&
rName
);
void
setPropertyValueFile
(
const
rtl
::
OUString
&
rName
,
const
com
::
sun
::
star
::
uno
::
Any
&
rVal
);
com
::
sun
::
star
::
uno
::
Any
getPropertyValueFile
(
const
rtl
::
OUString
&
rName
);
public
:
static
const
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>&
getUnoTunnelId
();
static
ScEditFieldObj
*
getImplementation
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
text
::
XTextContent
>&
xObj
);
...
...
sc/source/ui/unoobj/fielduno.cxx
Dosyayı görüntüle @
6dfe6693
...
...
@@ -1242,16 +1242,93 @@ uno::Any ScEditFieldObj::getPropertyValueURL(const rtl::OUString& rName)
return
aRet
;
}
void
ScEditFieldObj
::
setPropertyValueFile
(
const
rtl
::
OUString
&
rName
,
const
uno
::
Any
&
rVal
)
{
if
(
rName
==
SC_UNONAME_FILEFORM
)
{
sal_Int16
nIntVal
=
0
;
if
(
rVal
>>=
nIntVal
)
{
SvxFileFormat
eFormat
=
lcl_UnoToSvxFileFormat
(
nIntVal
);
if
(
pEditSource
)
{
ScEditEngineDefaulter
*
pEditEngine
=
((
ScHeaderFooterEditSource
*
)
pEditSource
)
->
GetEditEngine
();
ScUnoEditEngine
aTempEngine
(
pEditEngine
);
SvxFieldData
*
pField
=
aTempEngine
.
FindByPos
(
aSelection
.
nStartPara
,
aSelection
.
nStartPos
,
TYPE
(
SvxExtFileField
));
OSL_ENSURE
(
pField
,
"setPropertyValueFile: Field not found"
);
if
(
pField
)
{
SvxExtFileField
*
pExtFile
=
static_cast
<
SvxExtFileField
*>
(
pField
);
// local to the ScUnoEditEngine
pExtFile
->
SetFormat
(
eFormat
);
pEditEngine
->
QuickInsertField
(
SvxFieldItem
(
*
pField
,
EE_FEATURE_FIELD
),
aSelection
);
pEditSource
->
UpdateData
();
}
}
else
{
SvxFieldData
*
pField
=
getData
();
SvxExtFileField
*
pExtFile
=
static_cast
<
SvxExtFileField
*>
(
pField
);
pExtFile
->
SetFormat
(
eFormat
);
}
}
}
else
throw
beans
::
UnknownPropertyException
();
}
uno
::
Any
ScEditFieldObj
::
getPropertyValueFile
(
const
rtl
::
OUString
&
rName
)
{
uno
::
Any
aRet
;
if
(
rName
==
SC_UNONAME_FILEFORM
)
{
SvxFileFormat
eFormat
=
SVXFILEFORMAT_NAME_EXT
;
const
SvxFieldData
*
pField
=
NULL
;
if
(
pEditSource
)
{
ScEditEngineDefaulter
*
pEditEngine
=
((
ScHeaderFooterEditSource
*
)
pEditSource
)
->
GetEditEngine
();
ScUnoEditEngine
aTempEngine
(
pEditEngine
);
pField
=
aTempEngine
.
FindByPos
(
aSelection
.
nStartPara
,
aSelection
.
nStartPos
,
TYPE
(
SvxExtFileField
));
}
else
pField
=
getData
();
OSL_ENSURE
(
pField
,
"setPropertyValueFile: Field not found"
);
if
(
!
pField
)
throw
uno
::
RuntimeException
();
const
SvxExtFileField
*
pExtFile
=
static_cast
<
const
SvxExtFileField
*>
(
pField
);
eFormat
=
pExtFile
->
GetFormat
();
sal_Int16
nIntVal
=
lcl_SvxToUnoFileFormat
(
eFormat
);
aRet
<<=
nIntVal
;
}
else
throw
beans
::
UnknownPropertyException
();
return
aRet
;
}
ScEditFieldObj
::
ScEditFieldObj
(
const
uno
::
Reference
<
text
::
XTextRange
>&
rContent
,
SvxEditSource
*
pEditSrc
,
FieldType
eType
,
const
ESelection
&
rSel
)
:
OComponentHelper
(
getMutex
()),
pPropSet
(
lcl_GetURLPropertySet
()
),
pPropSet
(
NULL
),
pEditSource
(
pEditSrc
),
aSelection
(
rSel
),
meType
(
eType
),
mpData
(
NULL
),
mpContent
(
rContent
)
{
// pDocShell ist Null, wenn per ServiceProvider erzeugt
switch
(
meType
)
{
case
File
:
pPropSet
=
lcl_GetFileFieldPropertySet
();
break
;
case
URL
:
pPropSet
=
lcl_GetURLPropertySet
();
break
;
default
:
pPropSet
=
lcl_GetHeaderFieldPropertySet
();
}
}
void
ScEditFieldObj
::
InitDoc
(
...
...
@@ -1307,7 +1384,7 @@ rtl::OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
SolarMutexGuard
aGuard
;
if
(
!
pEditSource
)
return
rtl
::
OUString
();
return
rtl
::
OUString
(
"no edit source!!!"
);
//! Feld-Funktionen muessen an den Forwarder !!!
ScEditEngineDefaulter
*
pEditEngine
=
((
ScCellEditSource
*
)
pEditSource
)
->
GetEditEngine
();
...
...
@@ -1317,14 +1394,14 @@ rtl::OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
const
SvxFieldData
*
pField
=
aTempEngine
.
FindByPos
(
aSelection
.
nStartPara
,
aSelection
.
nStartPos
,
0
);
OSL_ENSURE
(
pField
,
"getPresentation: Feld nicht gefunden"
);
if
(
!
pField
)
return
rtl
::
OUString
();
return
rtl
::
OUString
(
"not inserted yet"
);
switch
(
meType
)
{
case
URL
:
{
if
(
pField
->
GetClassId
()
!=
SVX_URLFIELD
)
return
rtl
::
OUString
();
return
rtl
::
OUString
(
"not url field but url expected"
);
const
SvxURLField
*
pURL
=
static_cast
<
const
SvxURLField
*>
(
pField
);
return
bShowCommand
?
pURL
->
GetURL
()
:
pURL
->
GetRepresentation
();
...
...
@@ -1333,7 +1410,7 @@ rtl::OUString SAL_CALL ScEditFieldObj::getPresentation( sal_Bool bShowCommand )
default
:
;
}
return
rtl
::
OUString
(
"fail"
);
return
rtl
::
OUString
(
"
total
fail"
);
}
// XTextContent
...
...
@@ -1401,6 +1478,9 @@ void SAL_CALL ScEditFieldObj::setPropertyValue(
case
URL
:
setPropertyValueURL
(
aPropertyName
,
aValue
);
break
;
case
File
:
setPropertyValueFile
(
aPropertyName
,
aValue
);
break
;
default
:
throw
beans
::
UnknownPropertyException
();
}
...
...
@@ -1415,7 +1495,8 @@ uno::Any SAL_CALL ScEditFieldObj::getPropertyValue( const rtl::OUString& aProper
{
case
URL
:
return
getPropertyValueURL
(
aPropertyName
);
break
;
case
File
:
return
getPropertyValueFile
(
aPropertyName
);
default
:
throw
beans
::
UnknownPropertyException
();
}
...
...
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