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
79aa0c50
Kaydet (Commit)
79aa0c50
authored
Tem 15, 2013
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
RNG: Externalize strings and add .ui to UIConfig
Change-Id: I98620d235044365bcc67e29a72f036f5fdfd5e45
üst
2f8f3a0a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
26 deletions
+150
-26
AllLangResTarget_sc.mk
sc/AllLangResTarget_sc.mk
+1
-0
UIConfig_scalc.mk
sc/UIConfig_scalc.mk
+1
-0
globstr.hrc
sc/inc/globstr.hrc
+21
-0
RandomNumberGeneratorDialog.cxx
...urce/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+28
-26
RandomNumberGeneratorDialog.src
...urce/ui/StatisticsDialogs/RandomNumberGeneratorDialog.src
+99
-0
No files found.
sc/AllLangResTarget_sc.mk
Dosyayı görüntüle @
79aa0c50
...
...
@@ -83,6 +83,7 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/formdlg/formdlgs.src \
sc/source/ui/formdlg/dwfunctr.src \
sc/source/ui/sidebar/CellAppearancePropertyPanel.src \
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.src \
sc/source/core/src/compiler.src \
))
...
...
sc/UIConfig_scalc.mk
Dosyayı görüntüle @
79aa0c50
...
...
@@ -91,6 +91,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/printareasdialog \
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/randomnumbergenerator \
sc/uiconfig/scalc/ui/rightfooterdialog \
sc/uiconfig/scalc/ui/rightheaderdialog \
sc/uiconfig/scalc/ui/scgeneralpage \
...
...
sc/inc/globstr.hrc
Dosyayı görüntüle @
79aa0c50
...
...
@@ -683,6 +683,27 @@
#define STR_COUNT 553
#define STR_UNDO_DISTRIBUTION_TEMPLATE 554
#define STR_DISTRIBUTION_UNIFORM_REAL 555
#define STR_DISTRIBUTION_UNIFORM_INTEGER 556
#define STR_DISTRIBUTION_NORMAL 557
#define STR_DISTRIBUTION_CAUCHY 558
#define STR_DISTRIBUTION_BERNOULLI 559
#define STR_DISTRIBUTION_BINOMIAL 560
#define STR_DISTRIBUTION_NEGATIVE_BINOMIAL 561
#define STR_DISTRIBUTION_CHI_SQUARED 562
#define STR_DISTRIBUTION_GEOMETRIC 563
#define STR_RNG_PARAMETER_MINIMUM 564
#define STR_RNG_PARAMETER_MAXIMUM 565
#define STR_RNG_PARAMETER_MEAN 566
#define STR_RNG_PARAMETER_STANDARD_DEVIATION 567
#define STR_RNG_PARAMETER_STANDARD_MEDIAN 568
#define STR_RNG_PARAMETER_STANDARD_SIGMA 569
#define STR_RNG_PARAMETER_STANDARD_PROBABILITY 570
#define STR_RNG_PARAMETER_STANDARD_NUMBER_OF_TRIALS 571
#define STR_RNG_PARAMETER_STANDARD_NU_VALUE 572
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
Dosyayı görüntüle @
79aa0c50
...
...
@@ -213,63 +213,63 @@ void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers()
{
boost
::
random
::
uniform_real_distribution
<>
distribution
(
parameter1
,
parameter2
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
uniform_real_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Uniform Real"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_UNIFORM_REAL
)
));
break
;
}
case
DIST_UNIFORM_INTEGER
:
{
boost
::
random
::
uniform_int_distribution
<>
distribution
(
parameterInteger1
,
parameterInteger2
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
uniform_int_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Uniform Integer"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_UNIFORM_INTEGER
)
));
break
;
}
case
DIST_NORMAL
:
{
boost
::
random
::
normal_distribution
<>
distribution
(
parameter1
,
parameter2
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
normal_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Normal"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_NORMAL
)
));
break
;
}
case
DIST_CAUCHY
:
{
boost
::
random
::
cauchy_distribution
<>
distribution
(
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
cauchy_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Cauchy"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_CAUCHY
)
));
break
;
}
case
DIST_BERNOULLI
:
{
boost
::
random
::
bernoulli_distribution
<>
distribution
(
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
bernoulli_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Bernoulli"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_BERNOULLI
)
));
break
;
}
case
DIST_BINOMIAL
:
{
boost
::
random
::
binomial_distribution
<>
distribution
(
parameterInteger2
,
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
binomial_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Binomial"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_BINOMIAL
)
));
break
;
}
case
DIST_NEGATIVE_BINOMIAL
:
{
boost
::
random
::
negative_binomial_distribution
<>
distribution
(
parameterInteger2
,
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
negative_binomial_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Negative Binomial"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_NEGATIVE_BINOMIAL
)
));
break
;
}
case
DIST_CHI_SQUARED
:
{
boost
::
random
::
chi_squared_distribution
<>
distribution
(
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
chi_squared_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Chi Squared"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_CHI_SQUARED
)
));
break
;
}
case
DIST_GEOMETRIC
:
{
boost
::
random
::
geometric_distribution
<>
distribution
(
parameter1
);
boost
::
variate_generator
<
boost
::
mt19937
&
,
boost
::
random
::
geometric_distribution
<>
>
rng
(
seed
,
distribution
);
GenerateNumbers
(
rng
,
OUString
(
"Geometric"
));
GenerateNumbers
(
rng
,
OUString
(
ScResId
(
STR_DISTRIBUTION_GEOMETRIC
)
));
break
;
}
}
...
...
@@ -278,9 +278,9 @@ void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers()
template
<
class
RNG
>
void
ScRandomNumberGeneratorDialog
::
GenerateNumbers
(
RNG
randomGenerator
,
OUString
aDistributionName
)
{
OUString
aUndo
(
"Random ("
);
aUndo
+=
aDistributionName
;
aUndo
+=
")"
;
OUString
aUndo
=
ScResId
(
STR_UNDO_DISTRIBUTION_TEMPLATE
);
aUndo
=
aUndo
.
replaceAll
(
OUString
(
"$(DISTRIBUTION)"
),
aDistributionName
)
;
ScDocShell
*
pDocShell
=
mViewData
->
GetDocShell
();
svl
::
IUndoManager
*
pUndoManager
=
pDocShell
->
GetUndoManager
();
pUndoManager
->
EnterListAction
(
aUndo
,
aUndo
);
...
...
@@ -407,19 +407,19 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged)
{
case
DIST_UNIFORM
:
{
mpParameter1Text
->
SetText
(
OUString
(
"Minimum"
));
mpParameter2Text
->
SetText
(
OUString
(
"Maximum"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_MINIMUM
)
));
mpParameter2Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_MAXIMUM
)
));
mpParameter2Text
->
Show
();
mpParameter2Value
->
Show
();
break
;
}
case
DIST_UNIFORM_INTEGER
:
{
mpParameter1Text
->
SetText
(
OUString
(
"Minimum"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_MINIMUM
)
));
mpParameter1Value
->
SetDecimalDigits
(
0
);
mpParameter1Value
->
SetSpinSize
(
1
);
mpParameter2Text
->
SetText
(
OUString
(
"Maximum"
));
mpParameter2Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_MAXIMUM
)
));
mpParameter2Value
->
SetDecimalDigits
(
0
);
mpParameter2Value
->
SetSpinSize
(
1
);
...
...
@@ -429,16 +429,16 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged)
}
case
DIST_NORMAL
:
{
mpParameter1Text
->
SetText
(
OUString
(
"Mean"
));
mpParameter2Text
->
SetText
(
OUString
(
"Standard Deviation"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_MEAN
)
));
mpParameter2Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_DEVIATION
)
));
mpParameter2Text
->
Show
();
mpParameter2Value
->
Show
();
break
;
}
case
DIST_CAUCHY
:
{
mpParameter1Text
->
SetText
(
OUString
(
"Median"
));
mpParameter2Text
->
SetText
(
OUString
(
"Sigma"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_MEDIAN
)
));
mpParameter2Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_SIGMA
)
));
mpParameter2Text
->
Show
();
mpParameter2Value
->
Show
();
break
;
...
...
@@ -446,7 +446,7 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged)
case
DIST_BERNOULLI
:
case
DIST_GEOMETRIC
:
{
mpParameter1Text
->
SetText
(
OUString
(
"p Value"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_PROBABILITY
)
));
mpParameter1Value
->
SetMin
(
0
);
mpParameter1Value
->
SetMax
(
PERCISION
);
mpParameter1Value
->
SetSpinSize
(
1000
);
...
...
@@ -458,21 +458,23 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, DistributionChanged)
case
DIST_BINOMIAL
:
case
DIST_NEGATIVE_BINOMIAL
:
{
mpParameter1Text
->
SetText
(
OUString
(
"p Value"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_PROBABILITY
)
));
mpParameter1Value
->
SetMin
(
0
);
mpParameter1Value
->
SetMax
(
PERCISION
);
mpParameter1Value
->
SetSpinSize
(
1000
);
mpParameter2Text
->
SetText
(
OUString
(
"Number Of Trials"
));
mpParameter2Text
->
Show
();
mpParameter2Value
->
Show
();
mpParameter2Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_NUMBER_OF_TRIALS
)));
mpParameter2Value
->
SetDecimalDigits
(
0
);
mpParameter2Value
->
SetSpinSize
(
1
);
mpParameter2Value
->
SetMin
(
0
);
mpParameter2Text
->
Show
();
mpParameter2Value
->
Show
();
break
;
}
case
DIST_CHI_SQUARED
:
{
mpParameter1Text
->
SetText
(
OUString
(
"nu Value"
));
mpParameter1Text
->
SetText
(
OUString
(
ScResId
(
STR_RNG_PARAMETER_STANDARD_NU_VALUE
)
));
mpParameter2Text
->
Hide
();
mpParameter2Value
->
Hide
();
...
...
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.src
0 → 100644
Dosyayı görüntüle @
79aa0c50
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "globstr.hrc"
String STR_UNDO_DISTRIBUTION_TEMPLATE
{
Text [ en-US ] = "Random ($(DISTRIBUTION))";
};
String STR_DISTRIBUTION_UNIFORM_REAL
{
Text [ en-US ] = "Uniform";
};
String STR_DISTRIBUTION_UNIFORM_INTEGER
{
Text [ en-US ] = "Uniform Integer";
};
String STR_DISTRIBUTION_NORMAL
{
Text [ en-US ] = "Normal";
};
String STR_DISTRIBUTION_CAUCHY
{
Text [ en-US ] = "Cauchy";
};
String STR_DISTRIBUTION_BERNOULLI
{
Text [ en-US ] = "Bernoulli";
};
String STR_DISTRIBUTION_BINOMIAL
{
Text [ en-US ] = "Binomial";
};
String STR_DISTRIBUTION_NEGATIVE_BINOMIAL
{
Text [ en-US ] = "Negative Binomial";
};
String STR_DISTRIBUTION_CHI_SQUARED
{
Text [ en-US ] = "Geometric";
};
String STR_DISTRIBUTION_GEOMETRIC
{
Text [ en-US ] = "Geometric";
};
String STR_RNG_PARAMETER_MINIMUM
{
Text [ en-US ] = "Minimum";
};
String STR_RNG_PARAMETER_MAXIMUM
{
Text [ en-US ] = "Maximum";
};
String STR_RNG_PARAMETER_MEAN
{
Text [ en-US ] = "Mean";
};
String STR_RNG_PARAMETER_STANDARD_DEVIATION
{
Text [ en-US ] = "Standard Deviation";
};
String STR_RNG_PARAMETER_STANDARD_MEDIAN
{
Text [ en-US ] = "Median";
};
String STR_RNG_PARAMETER_STANDARD_SIGMA
{
Text [ en-US ] = "Sigma";
};
String STR_RNG_PARAMETER_STANDARD_PROBABILITY
{
Text [ en-US ] = "p Value";
};
String STR_RNG_PARAMETER_STANDARD_NUMBER_OF_TRIALS
{
Text [ en-US ] = "Number Of Trials";
};
String STR_RNG_PARAMETER_STANDARD_NU_VALUE
{
Text [ en-US ] = "nu Value";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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