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
f59dcdb1
Kaydet (Commit)
f59dcdb1
authored
Mar 27, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reduce indentation by early bail-out.
Change-Id: I5965a38fdd4e80e22136905881a39eb38ffb7798
üst
942589b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
58 deletions
+57
-58
cellsuno.cxx
sc/source/ui/unoobj/cellsuno.cxx
+57
-58
No files found.
sc/source/ui/unoobj/cellsuno.cxx
Dosyayı görüntüle @
f59dcdb1
...
@@ -1389,69 +1389,68 @@ static sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRang
...
@@ -1389,69 +1389,68 @@ static sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRang
}
}
// used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl
// used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl
static
String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition
, sal_Bool bEnglish )
static
OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos
, sal_Bool bEnglish )
{
{
rtl::OUString aVal;
if (!pDoc)
if ( pDoc )
return EMPTY_OUSTRING;
ScBaseCell* pCell = pDoc->GetCell(rPos);
if (!pCell || pCell->GetCellType() == CELLTYPE_NOTE)
return EMPTY_OUSTRING;
OUString aVal;
CellType eType = pCell->GetCellType();
if (eType == CELLTYPE_FORMULA)
{
{
ScBaseCell* pCell = pDoc->GetCell( rPosition );
ScFormulaCell* pForm = (ScFormulaCell*)pCell;
if ( pCell && pCell->GetCellType() != CELLTYPE_NOTE )
pForm->GetFormula( aVal,formula::FormulaGrammar::mapAPItoGrammar( bEnglish, false));
return aVal;
}
SvNumberFormatter* pFormatter = bEnglish ? ScGlobal::GetEnglishFormatter() :
pDoc->GetFormatTable();
// Since the English formatter was constructed with
// LANGUAGE_ENGLISH_US the "General" format has index key 0,
// we don't have to query.
sal_uInt32 nNumFmt = bEnglish ? 0 : pDoc->GetNumberFormat(rPos);
if ( eType == CELLTYPE_EDIT )
{
// GetString an der EditCell macht Leerzeichen aus Umbruechen,
// hier werden die Umbrueche aber gebraucht
const EditTextObject* pData = ((ScEditCell*)pCell)->GetData();
if (pData)
{
{
CellType eType = pCell->GetCellType();
EditEngine& rEngine = pDoc->GetEditEngine();
if ( eType == CELLTYPE_FORMULA )
rEngine.SetText( *pData );
{
aVal = rEngine.GetText( LINEEND_LF );
ScFormulaCell* pForm = (ScFormulaCell*)pCell;
}
pForm->GetFormula( aVal,formula::FormulaGrammar::mapAPItoGrammar( bEnglish, false));
}
}
else
else
{
{
ScRefCellValue aCell;
SvNumberFormatter* pFormatter = bEnglish ? ScGlobal::GetEnglishFormatter() :
aCell.assign(*pCell);
pDoc->GetFormatTable();
ScCellFormat::GetInputString(aCell, nNumFmt, aVal, *pFormatter);
// Since the English formatter was constructed with
}
// LANGUAGE_ENGLISH_US the "General" format has index key 0,
// we don't have to query.
sal_uInt32 nNumFmt = bEnglish ?
0 :
pDoc->GetNumberFormat( rPosition );
if ( eType == CELLTYPE_EDIT )
{
// GetString an der EditCell macht Leerzeichen aus Umbruechen,
// hier werden die Umbrueche aber gebraucht
const EditTextObject* pData = ((ScEditCell*)pCell)->GetData();
if (pData)
{
EditEngine& rEngine = pDoc->GetEditEngine();
rEngine.SetText( *pData );
aVal = rEngine.GetText( LINEEND_LF );
}
}
else
{
ScRefCellValue aCell;
aCell.assign(*pCell);
ScCellFormat::GetInputString(aCell, nNumFmt, aVal, *pFormatter);
}
// ggf. ein ' davorhaengen wie in ScTabViewShell::UpdateInputHandler
// ggf. ein ' davorhaengen wie in ScTabViewShell::UpdateInputHandler
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
{
{
double fDummy;
double fDummy;
String aTempString = aVal;
String aTempString = aVal;
sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aTempString, nNumFmt, fDummy));
sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aTempString, nNumFmt, fDummy));
if ( bIsNumberFormat )
if ( bIsNumberFormat )
aTempString.Insert('\'',0);
aTempString.Insert('\'',0);
else if ( aTempString.Len() && aTempString.GetChar(0) == '\'' )
else if ( aTempString.Len() && aTempString.GetChar(0) == '\'' )
{
{
// if the string starts with a "'", add another one because setFormula
// if the string starts with a "'", add another one because setFormula
// strips one (like text input, except for "text" number formats)
// strips one (like text input, except for "text" number formats)
if ( bEnglish || ( pFormatter->GetType(nNumFmt) != NUMBERFORMAT_TEXT ) )
if ( bEnglish || ( pFormatter->GetType(nNumFmt) != NUMBERFORMAT_TEXT ) )
aTempString.Insert('\'',0);
aTempString.Insert('\'',0);
}
aVal = aTempString;
}
}
}
}
aVal = aTempString;
}
}
return aVal;
return aVal;
}
}
...
...
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